Page MenuHome
Paste P1082

T69156 bandaid
ActivePublic

Authored by Philipp Oeser (lichtwerk) on Aug 26 2019, 12:21 PM.
diff --git a/source/blender/makesrna/intern/rna_object_force.c b/source/blender/makesrna/intern/rna_object_force.c
index d082dfc694c..181317b6a2b 100644
--- a/source/blender/makesrna/intern/rna_object_force.c
+++ b/source/blender/makesrna/intern/rna_object_force.c
@@ -295,16 +295,20 @@ static void rna_PointCache_frame_step_range(
int rna_Cache_info_length(PointerRNA *ptr)
{
PointCache *cache = (PointCache *)ptr->data;
- Object *ob = (Object *)ptr->owner_id;
- if (!ob) {
- return 0;
- }
+ /* could be a scene! */
+ if (GS(ptr->owner_id->name) == ID_OB) {
+ Object *ob = (Object *)ptr->owner_id;
- PTCacheID pid = BKE_ptcache_id_find(ob, NULL, cache);
+ if (!ob) {
+ return 0;
+ }
- if (cache->flag & PTCACHE_FLAG_INFO_DIRTY) {
- BKE_ptcache_update_info(&pid);
+ PTCacheID pid = BKE_ptcache_id_find(ob, NULL, cache);
+
+ if (cache->flag & PTCACHE_FLAG_INFO_DIRTY) {
+ BKE_ptcache_update_info(&pid);
+ }
}
return (int)strlen(cache->info);