diff --git a/app/src/main/java/com/wbrawner/simplemarkdown/view/fragment/PreviewFragment.java b/app/src/main/java/com/wbrawner/simplemarkdown/view/fragment/PreviewFragment.java index 87b024e..4b1a461 100644 --- a/app/src/main/java/com/wbrawner/simplemarkdown/view/fragment/PreviewFragment.java +++ b/app/src/main/java/com/wbrawner/simplemarkdown/view/fragment/PreviewFragment.java @@ -55,9 +55,11 @@ public class PreviewFragment extends Fragment implements MarkdownPreviewView { @Override public void updatePreview(String html) { - markdownPreview.post(() -> { - markdownPreview.loadDataWithBaseURL(null, html, "text/html", "UTF-8", null); - }); + if (markdownPreview != null) { + markdownPreview.post(() -> { + markdownPreview.loadDataWithBaseURL(null, html, "text/html", "UTF-8", null); + }); + } } @Override