From 827d40b8b5584596251df46d6e793b1c427c9143 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?lollipopkit=F0=9F=8F=B3=EF=B8=8F=E2=80=8D=E2=9A=A7?= =?UTF-8?q?=EF=B8=8F?= <10864310+lollipopkit@users.noreply.github.com> Date: Thu, 15 Jan 2026 13:02:17 +0800 Subject: [PATCH] opt. --- lib/core/utils/server.dart | 4 +++- lib/data/model/sftp/req.dart | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/core/utils/server.dart b/lib/core/utils/server.dart index 6368c61f..70d48490 100644 --- a/lib/core/utils/server.dart +++ b/lib/core/utils/server.dart @@ -46,7 +46,9 @@ List resolveMergedJumpChain( if (jumpChain != null) { for (final s in jumpChain) { injectedSpiMap[s.id] = s; - injectedSpiMap[s.oldId] = s; + if (s.oldId.isNotEmpty) { + injectedSpiMap[s.oldId] = s; + } } } diff --git a/lib/data/model/sftp/req.dart b/lib/data/model/sftp/req.dart index 15421d90..20b97515 100644 --- a/lib/data/model/sftp/req.dart +++ b/lib/data/model/sftp/req.dart @@ -23,8 +23,10 @@ class SftpReq { final hopIds = spi.jumpChainIds ?? (spi.jumpId == null ? const [] : [spi.jumpId!]); for (final hopId in hopIds) { final hopSpi = Stores.server.box.get(hopId); - if (hopSpi == null) break; - + if (hopSpi == null) { + Loggers.app.warning('Jump server not found: $hopId, truncating chain'); + break; + } final hopKey = hopSpi.id.isNotEmpty ? hopSpi.id : hopSpi.oldId; if (!visited.add(hopKey)) { throw SSHErr(