fix from andguent on irc, wasn't checking for property type.
authorCampbell Barton <ideasman42@gmail.com>
Wed, 26 Jan 2011 16:21:54 +0000 (16:21 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Wed, 26 Jan 2011 16:21:54 +0000 (16:21 +0000)
source/blender/editors/space_image/image_buttons.c

index 7509903246bbbb5ea23fd2f500e579b6f69a040e..e68d9f6698686e19eb2f03f578ab59fb117f60f4 100644 (file)
@@ -781,15 +781,21 @@ void uiTemplateImage(uiLayout *layout, bContext *C, PointerRNA *ptr, const char
 
        if(!ptr->data)
                return;
-       
+
        prop= RNA_struct_find_property(ptr, propname);
        if(!prop) {
                printf("uiTemplateImage: property not found: %s.%s\n", RNA_struct_identifier(ptr->type), propname);
                return;
        }
 
+       if(RNA_property_type(prop) != PROP_POINTER) {
+               printf("uiTemplateImage: expected pointer property for %s.%s\n", RNA_struct_identifier(ptr->type), propname);
+               return;
+       }
+
        block= uiLayoutGetBlock(layout);
 
+
        imaptr= RNA_property_pointer_get(ptr, prop);
        ima= imaptr.data;
        iuser= userptr->data;