Fix NullPointerException

pull/183/merge
Alinson S. Xavier 8 years ago
parent 238a1c724d
commit b6501c9a29

@ -192,7 +192,7 @@ public abstract class CheckmarkList
Checkmark newest = getNewestComputed();
Checkmark oldest = getOldestComputed();
if (newest == null)
if (newest == null || oldest == null)
{
forceRecompute(from, to);
}
@ -208,6 +208,7 @@ public abstract class CheckmarkList
*
* @return oldest checkmark already computed
*/
@Nullable
protected abstract Checkmark getOldestComputed();
/**
@ -285,5 +286,6 @@ public abstract class CheckmarkList
*
* @return newest checkmark already computed
*/
@Nullable
protected abstract Checkmark getNewestComputed();
}

@ -72,6 +72,7 @@ public class MemoryCheckmarkList extends CheckmarkList
}
@Override
@Nullable
protected Checkmark getOldestComputed()
{
if(list.isEmpty()) return null;
@ -79,6 +80,7 @@ public class MemoryCheckmarkList extends CheckmarkList
}
@Override
@Nullable
protected Checkmark getNewestComputed()
{
if(list.isEmpty()) return null;

@ -153,6 +153,7 @@ public class SQLiteCheckmarkList extends CheckmarkList
}
@Override
@Nullable
protected Checkmark getOldestComputed()
{
check(habit.getId());

Loading…
Cancel
Save