Fixed NullPointerException on updating preview

This commit is contained in:
William Brawner 2017-08-30 17:59:34 -06:00 committed by William Brawner
parent 3e73ad4f46
commit 03800044cb

View file

@ -55,9 +55,11 @@ public class PreviewFragment extends Fragment implements MarkdownPreviewView {
@Override @Override
public void updatePreview(String html) { public void updatePreview(String html) {
markdownPreview.post(() -> { if (markdownPreview != null) {
markdownPreview.loadDataWithBaseURL(null, html, "text/html", "UTF-8", null); markdownPreview.post(() -> {
}); markdownPreview.loadDataWithBaseURL(null, html, "text/html", "UTF-8", null);
});
}
} }
@Override @Override