diff options
Diffstat (limited to 'source/blender/blenkernel/intern/pointcache.c')
-rw-r--r-- | source/blender/blenkernel/intern/pointcache.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c index 4711e61c767..c43f53cc4af 100644 --- a/source/blender/blenkernel/intern/pointcache.c +++ b/source/blender/blenkernel/intern/pointcache.c @@ -1883,8 +1883,7 @@ void BKE_ptcache_id_clear(PTCacheID *pid, int mode, int cfra) { int len; /* store the length of the string */ int i; - int sta = pid->cache->startframe; - int end = pid->cache->endframe; + int sta, end; /* mode is same as fopen's modes */ DIR *dir; @@ -1894,9 +1893,12 @@ void BKE_ptcache_id_clear(PTCacheID *pid, int mode, int cfra) char path_full[MAX_PTCACHE_FILE]; char ext[MAX_PTCACHE_PATH]; - if(!pid->cache || pid->cache->flag & PTCACHE_BAKED) + if(!pid || !pid->cache || pid->cache->flag & PTCACHE_BAKED) return; + sta = pid->cache->startframe; + end = pid->cache->endframe; + #ifndef DURIAN_POINTCACHE_LIB_OK /* don't allow clearing for linked objects */ if(pid->ob->id.lib) |