omnirom/android_packages_apps_Mms — pull request #1 by Schischu (2013-12-22 21:53:40+00:00)
Title: Don't crash if NetworkInfo is unavailable

If running on WiFi only tablet, com.android.mms crashes if wifi is switched off.
This commit fixes that by checking if NetworkInfo is available before accessing its members.

E/AndroidRuntime( 6020): FATAL EXCEPTION: main
E/AndroidRuntime( 6020): Process: com.android.mms, PID: 6020
E/AndroidRuntime( 6020): java.lang.RuntimeException: Unable to start receiver com.android.mms.transaction.MmsSystemEventReceiver: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.net.NetworkInfo.isAvailable()' on a null object reference
E/AndroidRuntime( 6020):	at android.app.ActivityThread.handleReceiver(ActivityThread.java:2426)
E/AndroidRuntime( 6020):	at android.app.ActivityThread.access$1700(ActivityThread.java:135)
E/AndroidRuntime( 6020):	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1272)
E/AndroidRuntime( 6020):	at android.os.Handler.dispatchMessage(Handler.java:102)
E/AndroidRuntime( 6020):	at android.os.Looper.loop(Looper.java:136)
E/AndroidRuntime( 6020):	at android.app.ActivityThread.main(ActivityThread.java:5017)
E/AndroidRuntime( 6020):	at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime( 6020):	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
E/AndroidRuntime( 6020):	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
E/AndroidRuntime( 6020): Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.net.NetworkInfo.isAvailable()' on a null object reference
E/AndroidRuntime( 6020):	at com.android.mms.transaction.MmsSystemEventReceiver.onReceive(MmsSystemEventReceiver.java:78)
E/AndroidRuntime( 6020):	at android.app.ActivityThread.handleReceiver(ActivityThread.java:2419)
E/AndroidRuntime( 6020):	... 8 more