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")
|
@ReactProp(name = "viewRef")
|
||||||
public void setViewRef(BlurringView view, int viewRef) {
|
public void setViewRef(BlurringView view, int viewRef) {
|
||||||
View viewToBlur = context.getCurrentActivity().findViewById(viewRef);
|
if (context != null && context.getCurrentActivity() != null) {
|
||||||
|
View viewToBlur = context.getCurrentActivity().findViewById(viewRef);
|
||||||
|
|
||||||
if (viewToBlur != null) {
|
if (viewToBlur != null) {
|
||||||
view.setBlurredView(viewToBlur);
|
view.setBlurredView(viewToBlur);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue