From 915587de4501a82487d3c355c247029f6a157341 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Tue, 29 Oct 2019 13:27:21 +0200 Subject: Fix crash on startup and restore missing settings --- indra/newview/app_settings/settings.xml | 22 ++++++++++++++++++++++ indra/newview/llpresetsmanager.cpp | 21 +++++++++++---------- 2 files changed, 33 insertions(+), 10 deletions(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 49601ae98f..a02cccb613 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -16299,6 +16299,28 @@ Value 0 + CameraOpacity + + Comment + Opacity of the Camera Controls floater + Persist + 1 + Type + F32 + Value + 1.0 + + PresetCameraActive + + Comment + Name of currently selected preference + Persist + 1 + Type + String + Value + + CefVerboseLog Comment diff --git a/indra/newview/llpresetsmanager.cpp b/indra/newview/llpresetsmanager.cpp index c1702b4132..17fefbe6b1 100644 --- a/indra/newview/llpresetsmanager.cpp +++ b/indra/newview/llpresetsmanager.cpp @@ -262,8 +262,6 @@ bool LLPresetsManager::savePreset(const std::string& subdirectory, std::string n } else if(PRESETS_CAMERA == subdirectory) { - gSavedSettings.setString("PresetGraphicActive", name); - name_list.clear(); getControlNames(name_list); name_list.push_back("PresetCameraActive"); @@ -292,14 +290,17 @@ bool LLPresetsManager::savePreset(const std::string& subdirectory, std::string n { std::string ctrl_name = *it; LLControlVariable* ctrl = gSavedSettings.getControl(ctrl_name).get(); - std::string comment = ctrl->getComment(); - std::string type = LLControlGroup::typeEnumToString(ctrl->type()); - LLSD value = ctrl->getValue(); - - paramsData[ctrl_name]["Comment"] = comment; - paramsData[ctrl_name]["Persist"] = 1; - paramsData[ctrl_name]["Type"] = type; - paramsData[ctrl_name]["Value"] = value; + if (ctrl) + { + std::string comment = ctrl->getComment(); + std::string type = LLControlGroup::typeEnumToString(ctrl->type()); + LLSD value = ctrl->getValue(); + + paramsData[ctrl_name]["Comment"] = comment; + paramsData[ctrl_name]["Persist"] = 1; + paramsData[ctrl_name]["Type"] = type; + paramsData[ctrl_name]["Value"] = value; + } } } -- cgit v1.2.3