mirror of
https://github.com/iSoron/uhabits.git
synced 2025-12-06 01:08:50 -06:00
Fix NullPointerException
This commit is contained in:
@@ -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());
|
||||||
|
|||||||
Reference in New Issue
Block a user