Offline First Android software client for CommCare, the world's largest platform for designing, managing, and deploying robust mobile applications to frontline workers worldwide
Fix NPE when logging memory when there are no app processes running. Here's the stacktrace:
Fatal Exception: java.lang.NullPointerException: Attempt to invoke interface method 'java.util.Iterator java.util.List.iterator()' on a null object reference
at org.commcare.CommCareApplication.logMemoryInfo(CommCareApplication.java:1299)
at org.commcare.CommCareApplication.onStateChanged(CommCareApplication.java:1247)
at androidx.lifecycle.LifecycleRegistry$ObserverWithState.dispatchEvent(LifecycleRegistry.java:360)
at androidx.lifecycle.LifecycleRegistry.backwardPass(LifecycleRegistry.java:290)
at androidx.lifecycle.LifecycleRegistry.sync(LifecycleRegistry.java:308)
at androidx.lifecycle.LifecycleRegistry.moveToState(LifecycleRegistry.java:151)
at androidx.lifecycle.LifecycleRegistry.handleLifecycleEvent(LifecycleRegistry.java:134)
at androidx.lifecycle.ProcessLifecycleOwner.dispatchPauseIfNeeded(ProcessLifecycleOwner.java:145)
at androidx.lifecycle.ProcessLifecycleOwner$1.run(ProcessLifecycleOwner.java:71)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:201)
at android.os.Looper.loop(Looper.java:288)
at android.app.ActivityThread.main(ActivityThread.java:7870)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1009)
Safety Assurance
[X] I have confidence that this PR will not introduce a regression for the reasons below
Summary
Fix NPE when logging memory when there are no app processes running. Here's the stacktrace:
Safety Assurance
Safety story
This is just to safeguard the logging from errors