Skip to content

Commit

Permalink
fix(android): missing null checks in Ti.UI.Label methods (#14174)
Browse files Browse the repository at this point in the history
  • Loading branch information
m1ga authored Jan 26, 2025
1 parent 4532539 commit de395b2
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -803,12 +803,20 @@ private void updateLabelText()
public int getLineCount()
{
MaterialTextView textView = (MaterialTextView) getNativeView();
return textView.getLineCount();
if (textView != null && textView.getLayout() != null) {
return textView.getLineCount();
} else {
return 0;
}
}

public String getVisibleText()
{
MaterialTextView textView = (MaterialTextView) getNativeView();
return textView.getLayout().getText().toString();
if (textView != null && textView.getLayout() != null) {
return textView.getLayout().getText().toString();
} else {
return "";
}
}
}

0 comments on commit de395b2

Please sign in to comment.