diff --git a/r5dev/sdklauncher/base_surface.cpp b/r5dev/sdklauncher/base_surface.cpp index 7dd4e39c..6582a347 100644 --- a/r5dev/sdklauncher/base_surface.cpp +++ b/r5dev/sdklauncher/base_surface.cpp @@ -228,7 +228,10 @@ void CBaseSurface::LoadSettings() return; attributeView = pSubKey->attribs["experimentalBuilds"]; - this->m_ExperimentalBuildsCheckbox->SetChecked(attributeView != "0"); + + // Make sure it at least has a value. + if (!attributeView.empty()) + this->m_ExperimentalBuildsCheckbox->SetChecked(attributeView != "0"); } catch (const std::exception& e) { @@ -293,7 +296,7 @@ void CBaseSurface::SaveSettings() void CBaseSurface::OnUpdateClick(Forms::Control* Sender) { - //CBaseSurface* pSurf = (CBaseSurface*)Sender; + CBaseSurface* pSurf = (CBaseSurface*)Sender->FindForm(); vector vecHandles; EnumWindows(EnumWindowsProc, reinterpret_cast(&vecHandles)); @@ -339,7 +342,8 @@ void CBaseSurface::OnUpdateClick(Forms::Control* Sender) pProgress->ShowDialog(); - // Restart the launcher process from here through updater.exe! + // Save settings and restart the launcher process from here through updater.exe! + pSurf->SaveSettings(); SDKLauncher_Restart(); }