summaryrefslogtreecommitdiffstats
path: root/gui/fileselector.cpp
diff options
context:
space:
mode:
authorEthan Yonker <dees_troy@teamw.in>2018-08-24 18:17:36 +0200
committerEthan Yonker <dees_troy@teamw.in>2018-08-24 18:17:39 +0200
commit58f2132bc3954fc704787d477500a209eedb8e29 (patch)
treeeb0f79aacd68724b0c0c091018384ef924380f47 /gui/fileselector.cpp
parentRemove remaining pieces of supersu (diff)
parentSnap for 4745538 from 723056a83f8c8b15af02d9c302862dbb2304ea8c to pi-release (diff)
downloadandroid_bootable_recovery-58f2132bc3954fc704787d477500a209eedb8e29.tar
android_bootable_recovery-58f2132bc3954fc704787d477500a209eedb8e29.tar.gz
android_bootable_recovery-58f2132bc3954fc704787d477500a209eedb8e29.tar.bz2
android_bootable_recovery-58f2132bc3954fc704787d477500a209eedb8e29.tar.lz
android_bootable_recovery-58f2132bc3954fc704787d477500a209eedb8e29.tar.xz
android_bootable_recovery-58f2132bc3954fc704787d477500a209eedb8e29.tar.zst
android_bootable_recovery-58f2132bc3954fc704787d477500a209eedb8e29.zip
Diffstat (limited to '')
-rw-r--r--gui/fileselector.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/gui/fileselector.cpp b/gui/fileselector.cpp
index c4aaab168..fe378c848 100644
--- a/gui/fileselector.cpp
+++ b/gui/fileselector.cpp
@@ -112,8 +112,17 @@ GUIFileSelector::GUIFileSelector(xml_node<>* node) : GUIScrollList(node)
mFolderIcon = LoadAttrImage(child, "folder");
mFileIcon = LoadAttrImage(child, "file");
}
- int iconWidth = std::max(mFolderIcon->GetWidth(), mFileIcon->GetWidth());
- int iconHeight = std::max(mFolderIcon->GetHeight(), mFileIcon->GetHeight());
+ int iconWidth = 0, iconHeight = 0;
+ if (mFolderIcon && mFolderIcon->GetResource() && mFileIcon && mFileIcon->GetResource()) {
+ iconWidth = std::max(mFolderIcon->GetWidth(), mFileIcon->GetWidth());
+ iconHeight = std::max(mFolderIcon->GetHeight(), mFileIcon->GetHeight());
+ } else if (mFolderIcon && mFolderIcon->GetResource()) {
+ iconWidth = mFolderIcon->GetWidth();
+ iconHeight = mFolderIcon->GetHeight();
+ } else if (mFileIcon && mFileIcon->GetResource()) {
+ iconWidth = mFileIcon->GetWidth();
+ iconHeight = mFileIcon->GetHeight();
+ }
SetMaxIconSize(iconWidth, iconHeight);
// Fetch the file/folder list