浏览代码

NPE in setting note

Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
tobiasKaminsky 5 年之前
父节点
当前提交
ccd6dfaec0
共有 1 个文件被更改,包括 7 次插入2 次删除
  1. 7 2
      src/main/java/com/owncloud/android/ui/dialog/NoteDialogFragment.java

+ 7 - 2
src/main/java/com/owncloud/android/ui/dialog/NoteDialogFragment.java

@@ -136,8 +136,13 @@ public class NoteDialogFragment extends DialogFragment implements DialogInterfac
             ComponentsGetter componentsGetter = (ComponentsGetter) getActivity();
 
             if (componentsGetter != null) {
-                componentsGetter.getFileOperationsHelper().updateNoteToShare(share,
-                    noteEditText.getText().toString().trim());
+                String note = "";
+
+                if (noteEditText.getText() != null) {
+                    note = noteEditText.getText().toString().trim();
+                }
+
+                componentsGetter.getFileOperationsHelper().updateNoteToShare(share, note);
             } else {
                 DisplayUtils.showSnackMessage(requireActivity(), R.string.note_could_not_sent);
             }