Browse Source

Replace null check with assert due to ContextCompat.getDrawable nullability

Signed-off-by: Alper Ozturk <alperozturk@lions-macbook.local>
Signed-off-by: alperozturk <alper_ozturk@proton.me>
Alper Ozturk 1 year ago
parent
commit
48bdbac2a3
1 changed files with 3 additions and 1 deletions
  1. 3 1
      app/src/main/java/com/owncloud/android/datamodel/OCFile.java

+ 3 - 1
app/src/main/java/com/owncloud/android/datamodel/OCFile.java

@@ -668,11 +668,13 @@ public class OCFile implements Parcelable, Comparable<OCFile>, ServerFileInterfa
 
 
     public LayerDrawable getFileIcon(boolean isAutoUploadFolder, Context context) {
     public LayerDrawable getFileIcon(boolean isAutoUploadFolder, Context context) {
         Drawable folderDrawable = ContextCompat.getDrawable(context, R.drawable.folder);
         Drawable folderDrawable = ContextCompat.getDrawable(context, R.drawable.folder);
+        assert(folderDrawable != null);
+
         LayerDrawable folderLayerDrawable = new LayerDrawable(new Drawable[] { folderDrawable } );
         LayerDrawable folderLayerDrawable = new LayerDrawable(new Drawable[] { folderDrawable } );
 
 
         Integer overlayIconId = getFileOverlayIconId(isAutoUploadFolder);
         Integer overlayIconId = getFileOverlayIconId(isAutoUploadFolder);
 
 
-        if (overlayIconId == null || folderDrawable == null) {
+        if (overlayIconId == null) {
             return folderLayerDrawable;
             return folderLayerDrawable;
         }
         }