diff --git a/examples/editModels.js b/examples/editModels.js index 2741bdccdd..0a908595a3 100644 --- a/examples/editModels.js +++ b/examples/editModels.js @@ -1312,7 +1312,6 @@ var toolBar = (function () { if (clickedOverlay === loadFileMenuItem) { toggleNewModelButton(false); - // TODO BUG: this is bug, if the user has never uploaded a model, this will throw an JS exception file = Window.browse("Select your model file ...", Settings.getValue("LastModelUploadLocation").path(), "Model files (*.fst *.fbx)"); diff --git a/examples/newEditEntities.js b/examples/newEditEntities.js index b753537631..49dd46033b 100644 --- a/examples/newEditEntities.js +++ b/examples/newEditEntities.js @@ -238,7 +238,6 @@ var toolBar = (function () { if (clickedOverlay === loadFileMenuItem) { toggleNewModelButton(false); - // TODO BUG: this is bug, if the user has never uploaded a model, this will throw an JS exception file = Window.browse("Select your model file ...", Settings.getValue("LastModelUploadLocation").path(), "Model files (*.fst *.fbx)"); diff --git a/interface/src/scripting/SettingsScriptingInterface.cpp b/interface/src/scripting/SettingsScriptingInterface.cpp index ea9d645a94..21a5244138 100644 --- a/interface/src/scripting/SettingsScriptingInterface.cpp +++ b/interface/src/scripting/SettingsScriptingInterface.cpp @@ -22,6 +22,9 @@ QVariant SettingsScriptingInterface::getValue(const QString& setting) { QSettings* settings = Application::getInstance()->lockSettings(); QVariant value = settings->value(setting); Application::getInstance()->unlockSettings(); + if (!value.isValid()) { + value = ""; + } return value; } @@ -29,6 +32,9 @@ QVariant SettingsScriptingInterface::getValue(const QString& setting, const QVar QSettings* settings = Application::getInstance()->lockSettings(); QVariant value = settings->value(setting, defaultValue); Application::getInstance()->unlockSettings(); + if (!value.isValid()) { + value = ""; + } return value; }