Skip to content

fix(android): ignore null sensor orientation events#82

Open
pckimlong wants to merge 1 commit into
rmtmckenzie:masterfrom
pckimlong:fix-null-sensor-orientation
Open

fix(android): ignore null sensor orientation events#82
pckimlong wants to merge 1 commit into
rmtmckenzie:masterfrom
pckimlong:fix-null-sensor-orientation

Conversation

@pckimlong

Copy link
Copy Markdown

Fixes #49.

The Android sensor listener can be restarted before it has received its first orientation value. In that state lastOrientation is still null, but the plugin callback immediately calls orientation.name(), causing a NullPointerException.

This change ignores null startup orientation values at the platform callback boundary and continues emitting valid orientation events once Android reports one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"Attempt to invoke virtual method" occurs on NativeDeviceOrientationCommunicator.resume

1 participant