From 224c6ec7b684c0d156fa0e18caf047966b844e3d Mon Sep 17 00:00:00 2001 From: Hyhyhyyy <13581912370@139.com> Date: Sat, 15 Aug 2026 15:18:04 +0800 Subject: [PATCH] fix: do not store undefined tune data when a tune is in its default state --- src/components/block/index.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/block/index.ts b/src/components/block/index.ts index 36c4aa2ae..8432ed3de 100644 --- a/src/components/block/index.ts +++ b/src/components/block/index.ts @@ -552,7 +552,11 @@ export default class Block extends EventsDispatcher { .forEach(([name, tune]) => { if (_.isFunction(tune.save)) { try { - tunesData[name] = tune.save(); + const tuneData = tune.save() as BlockTuneData | undefined; + + if (tuneData !== undefined) { + tunesData[name] = tuneData; + } } catch (e) { _.log(`Tune ${tune.constructor.name} save method throws an Error %o`, 'warn', e); }