diff options
| author | Dave Houlton <euclid@lindenlab.com> | 2021-10-25 15:51:35 -0600 | 
|---|---|---|
| committer | Dave Houlton <euclid@lindenlab.com> | 2021-10-25 16:27:34 -0600 | 
| commit | 081ae57831b40d46acfe8f70e727ab804597ae58 (patch) | |
| tree | 53568fcf9ed3868089110ddcd555743227a788eb | |
| parent | 647d0224d321c706ba5936905db4265becde9d8e (diff) | |
SL-16246 protect null deference
| -rw-r--r-- | indra/newview/llappviewer.cpp | 20 | 
1 files changed, 12 insertions, 8 deletions
| diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 8492aba222..400a6a722b 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -864,8 +864,6 @@ bool LLAppViewer::init()  	LLNotifications::instance();  	LL_INFOS("InitInfo") << "Notifications initialized." << LL_ENDL ; -    writeSystemInfo(); -  	//////////////////////////////////////////////////////////////////////////////  	//////////////////////////////////////////////////////////////////////////////  	////////////////////////////////////////////////////////////////////////////// @@ -986,6 +984,9 @@ bool LLAppViewer::init()  	initWindow();  	LL_INFOS("InitInfo") << "Window is initialized." << LL_ENDL ; +    // writeSystemInfo can be called after window is initialized (gViewerWindow non-null) +    writeSystemInfo(); +  	// initWindow also initializes the Feature List, so now we can initialize this global.  	LLCubeMap::sUseCubeMaps = LLFeatureManager::getInstance()->isFeatureAvailable("RenderCubeMap"); @@ -3540,12 +3541,15 @@ void LLAppViewer::writeSystemInfo()  	gDebugInfo["FirstLogin"] = LLSD::Boolean(gAgent.isFirstLogin());  	gDebugInfo["FirstRunThisInstall"] = gSavedSettings.getBOOL("FirstRunThisInstall");      gDebugInfo["StartupState"] = LLStartUp::getStartupStateString(); - -	std::vector<std::string> resolutions = gViewerWindow->getWindow()->getDisplaysResolutionList(); -	for (auto res_iter : resolutions) -	{ -		gDebugInfo["DisplayInfo"].append(res_iter); -	} +     +    if (gViewerWindow) +    { +        std::vector<std::string> resolutions = gViewerWindow->getWindow()->getDisplaysResolutionList(); +        for (auto res_iter : resolutions) +        { +            gDebugInfo["DisplayInfo"].append(res_iter); +        } +    }  	writeDebugInfo(); // Save out debug_info.log early, in case of crash.  } | 
