Skip to content

Commit

Permalink
fix(android): fix stringify of View (#10742)
Browse files Browse the repository at this point in the history
* fix(android): handleGetView null check

* fix(android): add getOrCreateView() validation
  • Loading branch information
garymathews authored and ssjsamir committed Mar 25, 2019
1 parent 24b7308 commit 4becfe6
Showing 1 changed file with 12 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -488,14 +488,15 @@ protected TiUIView handleGetView()
}

view = createView(activity);
if (view != null) {
if (isDecorView && baseActivity != null) {
baseActivity.setViewProxy(view.getProxy());
}

if (isDecorView && baseActivity != null) {
baseActivity.setViewProxy(view.getProxy());
realizeViews(view);
view.registerForTouch();
view.registerForKeyPress();
}

realizeViews(view);
view.registerForTouch();
view.registerForKeyPress();
}
return view;
}
Expand Down Expand Up @@ -1028,8 +1029,12 @@ public TiViewProxy getParent()
public String getBackgroundDisabledColor()
// clang-format on
{
TiUIView view = getOrCreateView();
if (view == null) {
return null;
}
// Try to get the background drawable if one is available.
TiBackgroundDrawable backgroundDrawable = getOrCreateView().getBackground();
TiBackgroundDrawable backgroundDrawable = view.getBackground();
// Guard for views without color state backgrounds.
if (backgroundDrawable == null) {
return null;
Expand Down

0 comments on commit 4becfe6

Please sign in to comment.