Fixes bug where app crashes when booted in airplane mode.

(cherry picked from commit b0cdb144cdc59edcf2403c6c1baa7dd4c5bd572e)