diff options
Diffstat (limited to 'gui/fileselector.cpp')
-rw-r--r-- | gui/fileselector.cpp | 13 |
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 |