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

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

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

Loading…
Cancel
Save