fix for crash when running in background mode and adjusting materials
authorCampbell Barton <ideasman42@gmail.com>
Thu, 11 Feb 2010 16:54:25 +0000 (16:54 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Thu, 11 Feb 2010 16:54:25 +0000 (16:54 +0000)
source/blender/blenkernel/intern/icons.c

index b9e3c59..d6f3050 100644 (file)
@@ -49,6 +49,7 @@
 
 #include "BKE_icons.h"
 #include "BKE_utildefines.h"
+#include "BKE_global.h" /* only for G.background test */
 
 #include "BLO_sys_types.h" // for intptr_t support
 
@@ -217,7 +218,7 @@ void BKE_icon_changed(int id)
 {
        Icon* icon = 0;
        
-       if (!id) return;
+       if (!id || G.background) return;
 
        icon = BLI_ghash_lookup(gIcons, SET_INT_IN_POINTER(id));
        
@@ -239,7 +240,7 @@ int BKE_icon_getid(struct ID* id)
 {
        Icon* new_icon = 0;
 
-       if (!id)
+       if (!id || G.background)
                return 0;
 
        if (id->icon_id)