mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-10 05:32:18 -06:00
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:
@@ -103,7 +103,9 @@ void CefWebGuiModule::startOrStopGui() {
|
||||
new GUIKeyboardHandler
|
||||
);
|
||||
_instance->initialize();
|
||||
_instance->loadUrl(_url);
|
||||
if (!_url.value().empty()) {
|
||||
_instance->loadUrl(_url);
|
||||
}
|
||||
}
|
||||
if (_visible) {
|
||||
webBrowserModule->attachEventHandler(_instance.get());
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user