Do not assume that the GuiName or a DashboardItem is provided (closes #1006)

Do not try to load an empty URL as it triggers an assert
This commit is contained in:
Alexander Bock
2019-12-27 20:10:48 +01:00
parent 0ea77f56c3
commit ce7795a67b
2 changed files with 7 additions and 3 deletions
+4 -2
View File
@@ -111,8 +111,10 @@ DashboardItem::DashboardItem(const ghoul::Dictionary& dictionary)
std::string identifier = dictionary.value<std::string>(IdentifierInfo.identifier);
setIdentifier(std::move(identifier));
std::string guiName = dictionary.value<std::string>(GuiNameInfo.identifier);
setGuiName(std::move(guiName));
if (dictionary.hasKeyAndValue<std::string>(GuiNameInfo.identifier)) {
std::string guiName = dictionary.value<std::string>(GuiNameInfo.identifier);
setGuiName(std::move(guiName));
}
addProperty(_isEnabled);
}