patch-package
patch-package copied to clipboard
Patch file parse error
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.
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 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
@ironwill1023 - My bad, sorry to mislead you.