You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
NullPointerException: Attempt to invoke virtual method 'boolean android.widget.FrameLayout.dispatchTouchEvent(android.view.MotionEvent)' on a null object reference
#274
Describe the bug
NullPointerException for Android when "toBack" is set to true.
NullPointerException: Attempt to invoke virtual method 'boolean android.widget.FrameLayout.dispatchTouchEvent(android.view.MotionEvent)' on a null object reference
To Reproduce
Steps to reproduce the behavior:
Integrate this plugin
Set "toBack" to true
Running app
When opening a screen that is invoking start of camera preview and user immediately clicks on screen when camera is not finished launching, app crashes
Expected behavior
App does not crash when clicking to early on screen..
Additional context
In the CameraPreview -> setupBroadcast method we invoke fragment.frameContainerLayout.dispatchTouchEvent(event);
This will crash when fragment.frameContainerLayout is null. This is not being checked accordingly. Please, check the current method below.
I think, there should be (null != fragment.frameContainerLayout) added to the if statement.
private void setupBroadcast() {
/** When touch event is triggered, relay it to camera view if needed so it can support pinch zoom */
getBridge().getWebView().setClickable(true);
getBridge()
.getWebView()
.setOnTouchListener(
new View.OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
if ((null != fragment) && (fragment.toBack == true)) {
fragment.frameContainerLayout.dispatchTouchEvent(event);
}
return false;
}
}
);
}
The text was updated successfully, but these errors were encountered:
Thanks this condition fixed the issue. But I am unable to reproduce this issue. It happens sometime, I don't know why. Please comment on this thread if anyone finds the root cause.
Describe the bug
NullPointerException for Android when "toBack" is set to true.
NullPointerException: Attempt to invoke virtual method 'boolean android.widget.FrameLayout.dispatchTouchEvent(android.view.MotionEvent)' on a null object reference
To Reproduce
Steps to reproduce the behavior:
Expected behavior
App does not crash when clicking to early on screen..
Additional context
In the CameraPreview -> setupBroadcast method we invoke fragment.frameContainerLayout.dispatchTouchEvent(event);
This will crash when fragment.frameContainerLayout is null. This is not being checked accordingly. Please, check the current method below.
I think, there should be
(null != fragment.frameContainerLayout)
added to the if statement.The text was updated successfully, but these errors were encountered: