diff --git a/app/src/org/commcare/tasks/EntityLoaderTask.java b/app/src/org/commcare/tasks/EntityLoaderTask.java index 68b6cc045..4ef721459 100644 --- a/app/src/org/commcare/tasks/EntityLoaderTask.java +++ b/app/src/org/commcare/tasks/EntityLoaderTask.java @@ -133,6 +133,8 @@ public void publishEntityLoadingProgress(EntityLoadingProgressPhase phase, int p @Override protected void onProgressUpdate(Integer... values) { - listener.deliverProgress(values); + if (listener != null) { + listener.deliverProgress(values); + } } } diff --git a/app/src/org/commcare/tasks/PrimeEntityCacheHelper.kt b/app/src/org/commcare/tasks/PrimeEntityCacheHelper.kt index 3f2af7ff7..117995361 100644 --- a/app/src/org/commcare/tasks/PrimeEntityCacheHelper.kt +++ b/app/src/org/commcare/tasks/PrimeEntityCacheHelper.kt @@ -47,7 +47,7 @@ class PrimeEntityCacheHelper private constructor() : Cancellable { @JvmStatic fun getInstance() = - instance ?: synchronized(this) { + instance ?: synchronized(PrimeEntityCacheHelper::class) { instance ?: PrimeEntityCacheHelper().also { instance = it } }