patch-package icon indicating copy to clipboard operation
patch-package copied to clipboard

Patch file parse error

Open eaglecoder1023 opened this issue 2 years ago • 3 comments

diff --git a/node_modules/@react-native-community/masked-view/android/src/main/java/org/reactnative/maskedview/RNCMaskedView.java b/node_modules/@react-native-community/masked-view/android/src/main/java/org/reactnative/maskedview/RNCMaskedView.java
index 289d287..bac74c1 100644
--- a/node_modules/@react-native-community/masked-view/android/src/main/java/org/reactnative/maskedview/RNCMaskedView.java
+++ b/node_modules/@react-native-community/masked-view/android/src/main/java/org/reactnative/maskedview/RNCMaskedView.java
@@ -35,7 +35,9 @@ public class RNCMaskedView extends ReactViewGroup {
     // draw the mask
     if (mBitmapMask != null) {
       mPaint.setXfermode(mPorterDuffXferMode);
-      canvas.drawBitmap(mBitmapMask, 0, 0, mPaint);
+      if (!mBitmapMask.isRecycled()) {
+        canvas.drawBitmap(mBitmapMask, 0, 0, mPaint);
+      }
       mPaint.setXfermode(null);
     }
   }
@@ -55,6 +57,9 @@ public class RNCMaskedView extends ReactViewGroup {
     }

     View maskView = getChildAt(0);
+    if (maskView == null) {
+      return;
+    }
     maskView.setVisibility(View.VISIBLE);
     this.mBitmapMask = getBitmapFromView(maskView);
     maskView.setVisibility(View.INVISIBLE);

This patch works fine on Mac but it fails in Win10. Please advise. Thanks.

eaglecoder1023 avatar Sep 17 '21 19:09 eaglecoder1023

I just ran into a similar issue as this one. Is there any chance you copy/pasted the file contents? I did that at first, and there were hidden characters that were making the .patch file unreadable. I copy/pasted the actual file, ran again, and it worked.

woodrufs avatar Sep 28 '21 13:09 woodrufs

@woodrufs No, I just ran patch-package in Win10 without copy/paste. It seems Win10 can't read patch file which is created from Mac. So I decided to use Mac. Not sure if Win10 patch would work on Mac. Lol

eaglecoder1023 avatar Sep 28 '21 14:09 eaglecoder1023

@ironwill1023 - My bad, sorry to mislead you.

woodrufs avatar Sep 28 '21 14:09 woodrufs