Under stressful conditions, like the Monkey tests, getActivity() can return null. We assume this occurs when the fragment has shut down but asynchronous commands are returning results. This change adds appropriate null checks but assumes during normal operation the checks are not needed. Bug: 7152711 Change-Id: I7a3736ccead33738dab1a36e78ae1d8042db6e94