mirror of
https://github.com/nextcloud/android.git
synced 2024-11-27 09:39:25 +03:00
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:
parent
6fc9970329
commit
48bdbac2a3
1 changed files with 3 additions and 1 deletions
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue