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

NullPointerException in applyTransformations #488

Open
gavrilikhin-d opened this issue Jul 28, 2023 · 0 comments
Open

NullPointerException in applyTransformations #488

gavrilikhin-d opened this issue Jul 28, 2023 · 0 comments

Comments

@gavrilikhin-d
Copy link

gavrilikhin-d commented Jul 28, 2023

bug report

When using handleGLSurfaceViewOnAndroid: true there is a non-frequent bug that crashes our app.
This code in applyTransformations throws NullPointerException:

// find all parents of the child view
View iterator = child;
do {
      ms.add(iterator);

      iterator = (View) iterator.getParent(); // This line throws
} while (iterator != root);

My guess is that iterator == root on first iteration, because there is a special case in getAllChildren, where view is a children of itself:

@NonNull
private List<View> getAllChildren(@NonNull final View v) {
        if (!(v instanceof ViewGroup)) {
            final ArrayList<View> viewArrayList = new ArrayList<>();
            viewArrayList.add(v);

            return viewArrayList;
        }
     // ...
    }

Version & Platform

[email protected] /Users/gavrilikhin_d/Code/chatroulette/app/mobile
├─┬ @react-native-async-storage/[email protected]
│ └── [email protected] deduped
├─┬ @react-native-firebase/[email protected]
│ └── [email protected] deduped
├─┬ @react-native-google-signin/[email protected]
│ └── [email protected] deduped
├─┬ @react-navigation/[email protected]
│ ├─┬ @react-navigation/[email protected]
│ │ └── [email protected] deduped
│ └── [email protected] deduped
├─┬ @react-navigation/[email protected]
│ └── [email protected] deduped
├─┬ @react-navigation/[email protected]
│ └── [email protected] deduped
├─┬ @sentry/[email protected]
│ └── [email protected] deduped
├─┬ @stripe/[email protected]
│ └── [email protected] deduped
├─┬ @testing-library/[email protected]
│ └── [email protected] deduped
├─┬ @voximplant/[email protected]
│ └── [email protected] deduped
├─┬ [email protected]
│ ├─┬ [email protected]
│ │ └── [email protected] deduped
│ └── [email protected] deduped
├─┬ [email protected]
│ └── [email protected] deduped
├─┬ [email protected]
│ └── [email protected] deduped
├─┬ [email protected]
│ └── [email protected] deduped
├─┬ [email protected]
│ └── [email protected] deduped
├─┬ [email protected]
│ └── [email protected] deduped
├─┬ [email protected]
│ └── [email protected] deduped
├─┬ [email protected] (git+ssh://[email protected]/react-native-webrtc/react-native-incall-manager.git#e66e99bc49c0ac859844a4d3f1b6214414c76d2a)
│ └── [email protected] deduped
├─┬ [email protected]
│ └── [email protected] deduped
├─┬ [email protected]
│ └── [email protected] deduped
├─┬ [email protected]
│ └── [email protected] deduped
├─┬ [email protected]
│ └── [email protected] deduped
├─┬ [email protected]
│ └── [email protected] deduped
├─┬ [email protected]
│ └── [email protected] deduped
├─┬ [email protected]
│ └── [email protected] deduped
├─┬ [email protected]
│ └── [email protected] deduped
├─┬ [email protected]
│ └── [email protected] deduped
├── [email protected]
└─┬ [email protected]
  └── [email protected] deduped

Platform: Android

Expected behavior

No crash

Actual behavior

Crash

Steps to reproduce the behavior

Couldn't find a way to reproduce

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

No branches or pull requests

1 participant