Skip to content

Commit

Permalink
Fixes a NullPointerException that crashes the app (#236)
Browse files Browse the repository at this point in the history
* Fix NullPointerException

* Fix syntax error
  • Loading branch information
chintanparikh authored and Kureev committed Nov 9, 2017
1 parent 734ac38 commit aca380c
Showing 1 changed file with 5 additions and 3 deletions.
Expand Up @@ -50,10 +50,12 @@ public void setDownsampleFactor(BlurringView view, int factor) {

@ReactProp(name = "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) {
view.setBlurredView(viewToBlur);
if (viewToBlur != null) {
view.setBlurredView(viewToBlur);
}
}
}
}

0 comments on commit aca380c

Please sign in to comment.