fix(HtmlParser): check if hashtag has text
Fixes a crash, where the text of an hashtag was empty, leading to an oob string access.
This commit is contained in:
parent
c2e6280a18
commit
7fa079e362
1 changed files with 1 additions and 1 deletions
|
@ -140,7 +140,7 @@ public class HtmlParser{
|
||||||
String href=el.attr("href");
|
String href=el.attr("href");
|
||||||
LinkSpan.Type linkType;
|
LinkSpan.Type linkType;
|
||||||
String text=el.text();
|
String text=el.text();
|
||||||
if(el.hasClass("hashtag") || text.startsWith("#")){
|
if(!TextUtils.isEmpty(text) && (el.hasClass("hashtag") || text.startsWith("#"))){
|
||||||
// MOSHIDON: we have slightly refactored this so that the hashtags properly work in akkoma
|
// MOSHIDON: we have slightly refactored this so that the hashtags properly work in akkoma
|
||||||
// TODO: upstream this
|
// TODO: upstream this
|
||||||
linkType=LinkSpan.Type.HASHTAG;
|
linkType=LinkSpan.Type.HASHTAG;
|
||||||
|
|
Loading…
Add table
Reference in a new issue