mcastillof / FakeTraveler

Fake where your phone is located (Mock location for Android).
GNU General Public License v3.0
356 stars 79 forks source link

java.lang.NullPointerException: Attempt to invoke interface method 'java.lang.String android.content.SharedPreferences.getString #24

Open shuhaowu opened 5 years ago

shuhaowu commented 5 years ago

Describe the bug A clear and concise description of what the bug is.

Information:

To Reproduce Uncertain. It just gets force closed every once in a while when active.

Expected behavior Not crash.

Logcat

06-16 23:42:33.668 18143 18143 E AndroidRuntime: FATAL EXCEPTION: main
06-16 23:42:33.668 18143 18143 E AndroidRuntime: Process: cl.coders.faketraveler, PID: 18143
06-16 23:42:33.668 18143 18143 E AndroidRuntime: java.lang.RuntimeException: Unable to start receiver cl.coders.faketraveler.ApplyMockBroadcastReceiver: java.lang.NullPointerException: Attempt to invoke interface method 'java.lang.String android.content.SharedPreferences.getString(java.lang.String, java.lang.String)' on a null object reference
06-16 23:42:33.668 18143 18143 E AndroidRuntime:    at android.app.ActivityThread.handleReceiver(ActivityThread.java:3194)
06-16 23:42:33.668 18143 18143 E AndroidRuntime:    at android.app.ActivityThread.-wrap17(Unknown Source:0)
06-16 23:42:33.668 18143 18143 E AndroidRuntime:    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1672)
06-16 23:42:33.668 18143 18143 E AndroidRuntime:    at android.os.Handler.dispatchMessage(Handler.java:106)
06-16 23:42:33.668 18143 18143 E AndroidRuntime:    at android.os.Looper.loop(Looper.java:164)
06-16 23:42:33.668 18143 18143 E AndroidRuntime:    at android.app.ActivityThread.main(ActivityThread.java:6494)
06-16 23:42:33.668 18143 18143 E AndroidRuntime:    at java.lang.reflect.Method.invoke(Native Method)
06-16 23:42:33.668 18143 18143 E AndroidRuntime:    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:440)
06-16 23:42:33.668 18143 18143 E AndroidRuntime:    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
06-16 23:42:33.668 18143 18143 E AndroidRuntime: Caused by: java.lang.NullPointerException: Attempt to invoke interface method 'java.lang.String android.content.SharedPreferences.getString(java.lang.String, java.lang.String)' on a null object reference
06-16 23:42:33.668 18143 18143 E AndroidRuntime:    at cl.coders.faketraveler.ApplyMockBroadcastReceiver.onReceive(ApplyMockBroadcastReceiver.java:30)
06-16 23:42:33.668 18143 18143 E AndroidRuntime:    at android.app.ActivityThread.handleReceiver(ActivityThread.java:3187)
06-16 23:42:33.668 18143 18143 E AndroidRuntime:    ... 8 more