Эх сурвалжийг харах

NPE in setting note

Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
tobiasKaminsky 5 жил өмнө
parent
commit
ccd6dfaec0

+ 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);
             }