Skip to content

Commit

Permalink
fix(android): avoid calling toString on empty clipboard text
Browse files Browse the repository at this point in the history
  • Loading branch information
sgtcoolguy committed Dec 11, 2020
1 parent c94e6a2 commit d0b632f
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,17 +71,20 @@ public Object getData(String type)
@Kroll.getProperty
public String getText()
{
return board().getText().toString();
CharSequence text = board().getText();
if (text != null) {
return text.toString();
}
return null;
}

@Kroll.method
public boolean hasData(@Kroll.argument(optional = true) String type)
{
if (type == null || isTextType(type)) {
return hasText();
} else {
return false;
}
return false;
}

@Kroll.method
Expand Down

0 comments on commit d0b632f

Please sign in to comment.