Bugfix #24570
authorTon Roosendaal <ton@blender.org>
Wed, 10 Nov 2010 16:49:42 +0000 (16:49 +0000)
committerTon Roosendaal <ton@blender.org>
Wed, 10 Nov 2010 16:49:42 +0000 (16:49 +0000)
When using a startup.blend without user prefs (themes etc) saved, Blender
crashed. Added a provision to then fall back to the compiled in startup,
including a print in console.

source/blender/windowmanager/intern/wm_files.c

index 2dbcb92..e6d750c 100644 (file)
@@ -340,7 +340,7 @@ int WM_read_homefile(bContext *C, wmOperator *op)
        ListBase wmbase;
        char tstr[FILE_MAXDIR+FILE_MAXFILE];
        int from_memory= op && strcmp(op->type->idname, "WM_OT_read_factory_settings")==0;
-       int success;
+       int success= 0;
        
        free_ttfont(); /* still weird... what does it here? */
                
@@ -366,7 +366,13 @@ int WM_read_homefile(bContext *C, wmOperator *op)
        
        if (!from_memory && BLI_exists(tstr)) {
                success = BKE_read_file(C, tstr, NULL);
-       } else {
+               
+               if(U.themes.first==NULL) {
+                       printf("\nError: No valid startup.blend, fall back to built-in default.\n\n");
+                       success = 0;
+               }
+       }
+       if(success==0) {
                success = BKE_read_file_from_memory(C, datatoc_startup_blend, datatoc_startup_blend_size, NULL);
                if (wmbase.first == NULL) wm_clear_default_size(C);
        }