Merge pull request #526 from FineFindus/fix/empty-hashtag

feat(Error): disable clicking + crash fix
This commit is contained in:
LucasGGamerM 2024-09-02 09:39:41 -03:00 committed by GitHub
commit f30e12f5c6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 11 additions and 1 deletions

View File

@ -39,6 +39,16 @@ public class ErrorStatusDisplayItem extends StatusDisplayItem{
findViewById(R.id.button_copy_error_details).setOnClickListener(this::copyErrorDetails);
}
@Override
public void onClick(){
// explicitly do nothing when clicked
}
@Override
public boolean isEnabled(){
return false;
}
@Override
public void onBind(ErrorStatusDisplayItem item) {
openInBrowserButton.setEnabled(item.status!=null && item.status.url!=null);

View File

@ -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;