mirror of
https://github.com/status-im/react-native-blur.git
synced 2025-02-17 02:46:36 +00:00
Fixes a NullPointerException that crashes the app (#236)
* Fix NullPointerException * Fix syntax error
This commit is contained in:
parent
734ac38f62
commit
aca380cee5
@ -50,6 +50,7 @@ public class BlurViewManager extends SimpleViewManager<BlurringView> {
|
|||||||
|
|
||||||
@ReactProp(name = "viewRef")
|
@ReactProp(name = "viewRef")
|
||||||
public void setViewRef(BlurringView view, int viewRef) {
|
public void setViewRef(BlurringView view, int viewRef) {
|
||||||
|
if (context != null && context.getCurrentActivity() != null) {
|
||||||
View viewToBlur = context.getCurrentActivity().findViewById(viewRef);
|
View viewToBlur = context.getCurrentActivity().findViewById(viewRef);
|
||||||
|
|
||||||
if (viewToBlur != null) {
|
if (viewToBlur != null) {
|
||||||
@ -57,3 +58,4 @@ public class BlurViewManager extends SimpleViewManager<BlurringView> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user