Skip to content

Commit 78ac631

Browse files
author
Fox
committed
Replace the pointer equivalency check with a falsey check on the UIView.
1 parent d92a431 commit 78ac631

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

ios/RNViewShot.m

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,12 @@ - (dispatch_queue_t)methodQueue
4747

4848
// Get view
4949
UIView *view;
50-
51-
if ((int)target == -1) {
50+
view = viewRegistry[target];
51+
BOOL nativeCapture = false;
52+
if (!view) {
5253
UIWindow *window = [[UIApplication sharedApplication] keyWindow];
5354
view = window.rootViewController.view;
54-
} else {
55-
view = viewRegistry[target];
55+
nativeCapture = true;
5656
}
5757

5858
if (!view) {
@@ -102,7 +102,7 @@ - (dispatch_queue_t)methodQueue
102102
scrollView.frame = CGRectMake(0, 0, scrollView.contentSize.width, scrollView.contentSize.height);
103103
}
104104

105-
if ((int)target == -1) {
105+
if (nativeCapture) {
106106
if ([[UIScreen mainScreen] respondsToSelector:@selector(scale)]) {
107107
UIGraphicsBeginImageContextWithOptions(view.window.bounds.size, NO, [UIScreen mainScreen].scale);
108108
} else {

0 commit comments

Comments
 (0)