Merging r49261 through r49263 from trunk into soc-2011-tomato
[blender-staging.git] / source / blender / editors / space_image / image_ops.c
index 56c950361fba04bac8ae5d0ca1118732a8d6766b..8e742895e3186fc0771aa8e90284657e3a9bff72 100644 (file)
@@ -915,12 +915,13 @@ static int image_open_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)
 
                if (prop) {
                        PointerRNA oldptr;
+                       Image *oldima;
 
                        oldptr = RNA_property_pointer_get(&ptr, prop);
-                       ima = (Image *)oldptr.id.data;
-                       /* unlikely but better avoid strange crash */
-                       if (ima && GS(ima->id.name) != ID_IM) {
-                               ima = NULL;
+                       oldima = (Image *)oldptr.id.data;
+                       /* unlikely to fail but better avoid strange crash */
+                       if (oldima && GS(oldima->id.name) != ID_IM) {
+                               ima = oldima;
                        }
                }
        }