svn merge -r37700:37800 https://svn.blender.org/svnroot/bf-blender/trunk/blender
[blender.git] / source / blender / makesrna / intern / rna_object.c
index 0e9fef9e0e03412050bc76ddb5b8dc6cb8d55b0f..bd5a6d823a0bb85e50ab3be2d690b193481f8801 100644 (file)
@@ -1025,8 +1025,13 @@ static void rna_Object_active_shape_key_index_range(PointerRNA *ptr, int *min, i
        Key *key= ob_get_key(ob);
 
        *min= 0;
-       *max= (key)? BLI_countlist(&key->block)-1: 0;
-       *max= MAX2(0, *max);
+       if(key) {
+               *max= BLI_countlist(&key->block)-1;
+               if(*max < 0) *max= 0;
+       }
+       else {
+               *max= 0;
+       }
 }
 
 static int rna_Object_active_shape_key_index_get(PointerRNA *ptr)