Skip to content

Commit

Permalink
Merge pull request #526 from FineFindus/fix/empty-hashtag
Browse files Browse the repository at this point in the history
feat(Error): disable clicking + crash fix
  • Loading branch information
LucasGGamerM authored Sep 2, 2024
2 parents 3a14fb5 + 7fa079e commit f30e12f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,16 @@ public Holder(Context context, ViewGroup parent) {
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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ public void head(@NonNull Node node, int depth){
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;
Expand Down

0 comments on commit f30e12f

Please sign in to comment.