Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix NullPointerException when registering the sensors #79681

Merged
merged 1 commit into from
Jul 31, 2023

Conversation

m4gr3d
Copy link
Contributor

@m4gr3d m4gr3d commented Jul 19, 2023

Fix NullPointerException reported by the Google Play console

Exception Process: org.godotengine.editor.v4:GodotProjectManager, PID: 24936
java.lang.RuntimeException: Unable to resume activity {org.godotengine.editor.v4/org.godotengine.editor.GodotProjectManager}: java.lang.NullPointerException: <get-mMagnetometer>(...) must not be null
  at android.app.ActivityThread.performResumeActivity (ActivityThread.java:4578)
  at android.app.ActivityThread.handleResumeActivity (ActivityThread.java:4610)
  at android.app.servertransaction.ResumeActivityItem.execute (ResumeActivityItem.java:52)
  at android.app.servertransaction.TransactionExecutor.executeLifecycleState (TransactionExecutor.java:176)
  at android.app.servertransaction.TransactionExecutor.execute (TransactionExecutor.java:97)
  at android.app.ActivityThread$H.handleMessage (ActivityThread.java:2144)
  at android.os.Handler.dispatchMessage (Handler.java:106)
  at android.os.Looper.loop (Looper.java:240)
  at android.app.ActivityThread.main (ActivityThread.java:8000)
  at java.lang.reflect.Method.invoke
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:603)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:947)
Caused by java.lang.NullPointerException: <get-mMagnetometer>(...) must not be null
  at org.godotengine.godot.Godot.getMMagnetometer (Godot.kt:97)
  at org.godotengine.godot.Godot.onResume (Godot.kt:497)
  at org.godotengine.godot.GodotFragment.onResume (GodotFragment.java:280)
  at androidx.fragment.app.Fragment.performResume (Fragment.java:3039)
  at androidx.fragment.app.FragmentStateManager.resume (FragmentStateManager.java:607)
  at androidx.fragment.app.FragmentStateManager.moveToExpectedState (FragmentStateManager.java:306)
  at androidx.fragment.app.FragmentStore.moveToExpectedState (FragmentStore.java:112)
  at androidx.fragment.app.FragmentManager.moveToState (FragmentManager.java:1647)
  at androidx.fragment.app.FragmentManager.dispatchStateChange (FragmentManager.java:3128)
  at androidx.fragment.app.FragmentManager.dispatchResume (FragmentManager.java:3086)
  at androidx.fragment.app.FragmentController.dispatchResume (FragmentController.java:273)
  at androidx.fragment.app.FragmentActivity.onResumeFragments (FragmentActivity.java:458)
  at androidx.fragment.app.FragmentActivity.onPostResume (FragmentActivity.java:447)
  at android.app.Activity.performResume (Activity.java:8238)
  at android.app.ActivityThread.performResumeActivity (ActivityThread.java:4565)

Bugsquad edit:

Copy link
Contributor

@BastiaanOlij BastiaanOlij left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@YuriSizov YuriSizov changed the title Fix npe when registering the sensors Fix NullPointerException when registering the sensors Jul 31, 2023
@YuriSizov YuriSizov merged commit 9fbb349 into godotengine:master Jul 31, 2023
@YuriSizov
Copy link
Contributor

Thanks!

@m4gr3d m4gr3d deleted the fix_npe_main branch July 31, 2023 20:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Quest 2 export in 4.2.dev2 not working
3 participants