From 73ebbaeff5afd45554edadbec48e184fcb239e75 Mon Sep 17 00:00:00 2001 From: windecay <4453636@qq.com> Date: Wed, 4 Feb 2026 23:52:06 +0800 Subject: [PATCH] fix NullCache --- nodes.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/nodes.py b/nodes.py index 18b138e..b2f4545 100644 --- a/nodes.py +++ b/nodes.py @@ -188,8 +188,13 @@ class DynamicRAMCacheControl: def _migrate_cache_data(self, old_cache, new_cache): """迁移缓存核心数据""" - new_cache.cache = old_cache.cache - new_cache.subcaches = old_cache.subcaches + # Fix for 'NullCache' object has no attribute 'cache' + if hasattr(old_cache, 'cache'): + new_cache.cache = old_cache.cache + + if hasattr(old_cache, 'subcaches'): + new_cache.subcaches = old_cache.subcaches + new_cache.dynprompt = getattr(old_cache, 'dynprompt', None) new_cache.cache_key_set = getattr(old_cache, 'cache_key_set', None) new_cache.initialized = getattr(old_cache, 'initialized', False)