prevent NPE

Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
This commit is contained in:
tobiasKaminsky 2019-12-02 13:24:38 +01:00
parent d1611f6334
commit b31cee531b
No known key found for this signature in database
GPG key ID: 0E00D4D47D0C5AF7

View file

@ -45,14 +45,18 @@ public class LoadUrlTask extends AsyncTask<String, Void, String> {
@Override
protected String doInBackground(String... fileId) {
if (editorWebViewWeakReference.get() == null) {
final EditorWebView editorWebView = editorWebViewWeakReference.get();
if (editorWebView == null) {
return "";
}
RemoteOperationResult result = null;
if (editorWebViewWeakReference.get() instanceof RichDocumentsEditorWebView) {
RemoteOperationResult result;
if (editorWebView instanceof RichDocumentsEditorWebView) {
result = new RichDocumentsUrlOperation(fileId[0]).execute(account, editorWebViewWeakReference.get());
} else if (editorWebViewWeakReference.get() instanceof TextEditorWebView) {
} else if (editorWebView instanceof TextEditorWebView) {
result = new DirectEditingOpenFileRemoteOperation(fileId[0], TEXT)
.execute(account, editorWebViewWeakReference.get());
} else {