Skip to content

patch-package: isRecycled() on a null object reference #2708

Open
@vijayanandof

Description

@vijayanandof

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch [email protected] for the project I'm working on.

isRecycled() on a null object reference

Here is the diff that solved my problem:

diff --git a/node_modules/react-native-svg/android/src/main/java/com/horcrux/svg/GroupView.java b/node_modules/react-native-svg/android/src/main/java/com/horcrux/svg/GroupView.java
index d5df75b..c56068b 100644
--- a/node_modules/react-native-svg/android/src/main/java/com/horcrux/svg/GroupView.java
+++ b/node_modules/react-native-svg/android/src/main/java/com/horcrux/svg/GroupView.java
@@ -165,7 +165,9 @@ class GroupView extends RenderableView {
       int saveCount = canvas.save();
       canvas.setMatrix(null);
       mLayerPaint.setAlpha((int) (mOpacity * 255));
-      canvas.drawBitmap(mLayerBitmap, 0, 0, mLayerPaint);
+      if (mLayerBitmap != null) {
+        canvas.drawBitmap(mLayerBitmap, 0, 0, mLayerPaint);
+      }
       canvas.restoreToCount(saveCount);
     }
     this.setClientRect(groupRect);

This issue body was partially generated by patch-package.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Missing infoThe user didn't precise the problem enoughMissing reproThis issue need minimum repro scenario

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions