Fix for [#24501] Apeend object with cloth sim from another file crash.
authorJanne Karhu <jhkarh@gmail.com>
Tue, 2 Nov 2010 15:21:43 +0000 (15:21 +0000)
committerJanne Karhu <jhkarh@gmail.com>
Tue, 2 Nov 2010 15:21:43 +0000 (15:21 +0000)
source/blender/blenkernel/intern/pointcache.c

index 37d2b103ef0ad3f3eaf71bc8d019647c1c1d87f4..bd37abc266bcd1e666fac567daa26b4beb3b5c47 100644 (file)
@@ -2002,7 +2002,7 @@ void BKE_ptcache_id_clear(PTCacheID *pid, int mode, int cfra)
                                        if((mode==PTCACHE_CLEAR_BEFORE && pm->frame < cfra)     || 
                                        (mode==PTCACHE_CLEAR_AFTER && pm->frame > cfra) ) {
                                                link = pm;
-                                               if(pm->frame >=sta && pm->frame <= end)
+                                               if(pid->cache->cached_frames && pm->frame >=sta && pm->frame <= end)
                                                        pid->cache->cached_frames[pm->frame-sta] = 0;
                                                ptcache_free_data(pm);
                                                pm = pm->next;