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:
@@ -140,7 +140,7 @@ public class HtmlParser{
|
||||
String href=el.attr("href");
|
||||
LinkSpan.Type linkType;
|
||||
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
|
||||
// TODO: upstream this
|
||||
linkType=LinkSpan.Type.HASHTAG;
|
||||
|
||||
Reference in New Issue
Block a user