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>
This commit is contained in:
Alper Ozturk 2023-10-04 09:21:38 +02:00 committed by alperozturk
parent 6fc9970329
commit 48bdbac2a3
No known key found for this signature in database
GPG key ID: 4E577DC593B59BDF

View file

@ -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;
} }