ide/GlobalSettingsDialog: Fixed a crash introduced in 6baa12647265b610401b943e2a7c86d...
authorJerome St-Louis <jerome@ecere.com>
Fri, 10 Aug 2012 23:43:24 +0000 (19:43 -0400)
committerJerome St-Louis <jerome@ecere.com>
Fri, 10 Aug 2012 23:43:24 +0000 (19:43 -0400)
ide/src/dialogs/GlobalSettingsDialog.ec

index d04b1b5..0ea4d6c 100644 (file)
@@ -89,17 +89,18 @@ class GlobalSettingsDialog : Window
             if(compilersTab.modifiedDocument)
             {
                bool foundActive = false;
+               Workspace workspace = ide.workspace;
                if(strcmp(compilersTab.compilerConfigsDir.path, ideSettings.compilerConfigsDir))
                   ideSettings.compilerConfigsDir = compilersTab.compilerConfigsDir.path;
                ideSettings.compilerConfigs.Free();
                for(compiler : compilersTab.compilerConfigs)
                {
                   ideSettings.compilerConfigs.Add(compiler.Copy());
-                  if(!foundActive && ide.workspace.compiler && !strcmp(ide.workspace.compiler, compiler.name))
+                  if(!foundActive && workspace && workspace.compiler && !strcmp(workspace.compiler, compiler.name))
                      foundActive = true;
                }
-               if(!foundActive)
-                  ide.workspace.compiler = defaultCompilerName;
+               if(workspace && !foundActive)
+                  workspace.compiler = defaultCompilerName;
 
                compilerSettingsChanged = true;
             }