Fix crash when trying to Commnet

Previously, if a post did not have any markdown in it, the app would not initialize Glide on the CommentActivity, causing a crash while loading the user icon. Now it will be initialized either way.

Closes #272
This commit is contained in:
Balazs Toldi 2024-08-04 14:31:33 +02:00
parent 5f345113f1
commit b70db40a03

View File

@ -170,6 +170,7 @@ public class CommentActivity extends BaseActivity implements UploadImageEnabledA
String parentBodyMarkdown = intent.getStringExtra(EXTRA_COMMENT_PARENT_BODY_MARKDOWN_KEY);
String parentBody = intent.getStringExtra(EXTRA_COMMENT_PARENT_BODY_KEY);
mGlide = Glide.with(getApplication());
if (parentBodyMarkdown != null && !parentBodyMarkdown.equals("")) {
binding.commentContentMarkdownView.setVisibility(View.VISIBLE);
binding.commentContentMarkdownView.setNestedScrollingEnabled(false);
@ -205,8 +206,6 @@ public class CommentActivity extends BaseActivity implements UploadImageEnabledA
}
};
mGlide = Glide.with(getApplication());
Markwon postBodyMarkwon = MarkdownUtils.createFullRedditMarkwon(this,
miscPlugin, parentTextColor, parentSpoilerBackgroundColor, mGlide, null, mSharedPreferences.getBoolean(SharedPreferencesUtils.DISABLE_IMAGE_PREVIEW, false));
MarkwonAdapter markwonAdapter = MarkdownUtils.createTablesAdapter();