Fixes a NullPointerException that crashes the app (#236)

* Fix NullPointerException

* Fix syntax error
This commit is contained in:
Chintan Parikh 2017-11-09 04:11:38 -08:00 committed by Alexey
parent 734ac38f62
commit aca380cee5

View File

@ -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> {
} }
} }
} }
}