Skip to content

NullPointerException: Attempt to invoke virtual method ... on a null object reference #161

@mate-from-mattr

Description

@mate-from-mattr

One of my colleagues reported this crash to me. Sometimes the app will open, and show the splash screen for a split second, and then crash. When this happens, he tries a few more times. After a few attempts, the app opens up fine and he can use it.

11-10 13:30:47.203 E/AndroidRuntime(23581): java.lang.NullPointerException: Attempt to invoke virtual method 'boolean com.ninty.system.setting.SystemSetting$g.a()' on a null object reference
11-10 13:30:47.203 E/AndroidRuntime(23581): 	at com.ninty.system.setting.SystemSetting.registerVolumeReceiver(Unknown Source:2)
11-10 13:30:47.203 E/AndroidRuntime(23581): 	at com.ninty.system.setting.SystemSetting.onHostResume(Unknown Source:0)
11-10 13:30:47.203 E/AndroidRuntime(23581): 	at com.facebook.react.bridge.ReactContext$1.run(Unknown Source:17)
11-10 13:30:47.203 E/AndroidRuntime(23581): 	at android.os.Handler.handleCallback(Handler.java:959)
11-10 13:30:47.203 E/AndroidRuntime(23581): 	at android.os.Handler.dispatchMessage(Handler.java:100)
11-10 13:30:47.203 E/AndroidRuntime(23581): 	at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(Unknown Source:5)
11-10 13:30:47.203 E/AndroidRuntime(23581): 	at android.os.Looper.loopOnce(Looper.java:257)
11-10 13:30:47.203 E/AndroidRuntime(23581): 	at android.os.Looper.loop(Looper.java:342)
11-10 13:30:47.203 E/AndroidRuntime(23581): 	at android.app.ActivityThread.main(ActivityThread.java:9638)
11-10 13:30:47.203 E/AndroidRuntime(23581): 	at java.lang.reflect.Method.invoke(Native Method)
11-10 13:30:47.203 E/AndroidRuntime(23581): 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:619)
11-10 13:30:47.203 E/AndroidRuntime(23581): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:929)

Looking at the source for registerVolumeReceiver, I think volumeBR may be null? Looking at stack trace, it looks like it's calling a method that returns bool. I'm not absolutely sure. If it is null, I wondered also if it might be a race condition, where volumeBR is set to null at one point, and instantiated at another. Not sure!

Is this a problem with the way i'm using the library, or with the library itself?

Using react-native: 0.79.5, but don't have many more details at this time. May be able to get you more if you need.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions