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

files: avoid possible dereference of null pointer.

it seems the `capability` object can be null. In which case it is probably a bad idea to pass a null object into `getRichDocumentsDirectEditing()`.

Signed-off-by: ardevd <edvard.holst@gmail.com>
ardevd 6 жил өмнө
parent
commit
b96414d794

+ 3 - 1
src/main/java/com/owncloud/android/files/FileMenuFilter.java

@@ -184,7 +184,9 @@ public class FileMenuFilter {
         filterUnsetEncrypted(toShow, toHide, endToEndEncryptionEnabled);
         filterSetPictureAs(toShow, toHide);
         filterStream(toShow, toHide);
-        filterOpenAsRichDocument(toShow, toHide, capability);
+        if (endToEndEncryptionEnabled) {
+            filterOpenAsRichDocument(toShow, toHide, capability);
+        }
     }
 
     private void filterShareFile(List<Integer> toShow, List<Integer> toHide, OCCapability capability) {