fix NPE
This commit is contained in:
parent
7d4eec6c99
commit
ab41541c69
1 changed files with 5 additions and 5 deletions
|
@ -1414,13 +1414,13 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
|
||||||
final long fromTime;
|
final long fromTime;
|
||||||
final long endTime;
|
final long endTime;
|
||||||
|
|
||||||
APSResult apsResult;
|
APSResult apsResult = null;
|
||||||
if (Config.APS)
|
|
||||||
apsResult = finalLastRun.constraintsProcessed;
|
|
||||||
else
|
|
||||||
apsResult = NSDeviceStatus.getAPSResult();
|
|
||||||
|
|
||||||
if (finalPredictionsAvailable && SP.getBoolean("showprediction", false)) {
|
if (finalPredictionsAvailable && SP.getBoolean("showprediction", false)) {
|
||||||
|
if (Config.APS)
|
||||||
|
apsResult = finalLastRun.constraintsProcessed;
|
||||||
|
else
|
||||||
|
apsResult = NSDeviceStatus.getAPSResult();
|
||||||
int predHours = (int) (Math.ceil(apsResult.getLatestPredictionsTime() - System.currentTimeMillis()) / (60 * 60 * 1000));
|
int predHours = (int) (Math.ceil(apsResult.getLatestPredictionsTime() - System.currentTimeMillis()) / (60 * 60 * 1000));
|
||||||
predHours = Math.min(2, predHours);
|
predHours = Math.min(2, predHours);
|
||||||
predHours = Math.max(0, predHours);
|
predHours = Math.max(0, predHours);
|
||||||
|
|
Loading…
Reference in a new issue