From ec48c5d3a4beff8e74cc5dd155c04802906df9fd Mon Sep 17 00:00:00 2001 From: Aloshi Date: Thu, 16 May 2013 13:27:19 -0500 Subject: [PATCH] Fixed a crash with empty path names in theme box definitions. --- src/components/GuiTheme.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/components/GuiTheme.cpp b/src/components/GuiTheme.cpp index 6bc27a07a..476780acf 100644 --- a/src/components/GuiTheme.cpp +++ b/src/components/GuiTheme.cpp @@ -332,6 +332,9 @@ Gui* GuiTheme::createElement(pugi::xml_node data, Gui* parent) //expands a file path (./ becomes the directory of this theme file, ~/ becomes $HOME/) std::string GuiTheme::expandPath(std::string path) { + if(path.length() == 0) + return ""; + if(path[0] == '~') path = getHomePath() + path.substr(1, path.length() - 1); else if(path[0] == '.')