@@ -3145,20 +3145,21 @@ def render_cache_json(self):
3145
3145
3146
3146
# Get final cache object from timeline
3147
3147
try :
3148
- cache_object = self .window .timeline_sync .timeline .GetCache ()
3149
- if not cache_object or cache_object .Count () <= 0 :
3150
- return
3151
- # Get the JSON from the cache object (i.e. which frames are cached)
3152
- cache_json = self .window .timeline_sync .timeline .GetCache ().Json ()
3153
- cache_dict = json .loads (cache_json )
3154
- cache_version = cache_dict ["version" ]
3155
-
3156
- if self .cache_renderer_version == cache_version :
3157
- # Nothing has changed, ignore
3158
- return
3159
- # Cache has changed, re-render it
3160
- self .cache_renderer_version = cache_version
3161
- self .run_js (JS_SCOPE_SELECTOR + ".renderCache({});" .format (cache_json ))
3148
+ if self .window .timeline_sync and self .window .timeline_sync .timeline :
3149
+ cache_object = self .window .timeline_sync .timeline .GetCache ()
3150
+ if not cache_object or cache_object .Count () <= 0 :
3151
+ return
3152
+ # Get the JSON from the cache object (i.e. which frames are cached)
3153
+ cache_json = self .window .timeline_sync .timeline .GetCache ().Json ()
3154
+ cache_dict = json .loads (cache_json )
3155
+ cache_version = cache_dict ["version" ]
3156
+
3157
+ if self .cache_renderer_version == cache_version :
3158
+ # Nothing has changed, ignore
3159
+ return
3160
+ # Cache has changed, re-render it
3161
+ self .cache_renderer_version = cache_version
3162
+ self .run_js (JS_SCOPE_SELECTOR + ".renderCache({});" .format (cache_json ))
3162
3163
except Exception as ex :
3163
3164
# Log the exception and ignore
3164
3165
log .warning ("Exception processing timeline cache: %s" , ex )
0 commit comments