Fixes a NullPointerException that crashes the app (#236)
* Fix NullPointerException * Fix syntax error
This commit is contained in:
parent
734ac38f62
commit
aca380cee5
|
@ -50,10 +50,12 @@ public class BlurViewManager extends SimpleViewManager<BlurringView> {
|
|||
|
||||
@ReactProp(name = "viewRef")
|
||||
public void setViewRef(BlurringView view, int viewRef) {
|
||||
if (context != null && context.getCurrentActivity() != null) {
|
||||
View viewToBlur = context.getCurrentActivity().findViewById(viewRef);
|
||||
|
||||
if (viewToBlur != null) {
|
||||
view.setBlurredView(viewToBlur);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue