From 748c5cf4a88241861047582db2b845b022aa76df Mon Sep 17 00:00:00 2001 From: oldshensheep Date: Mon, 1 May 2023 20:53:49 +0800 Subject: [PATCH] fix crash and fix migration qqwry #161 (#162) * fix crash #161 * fix migration qqwry --- internal/migration/v7.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/internal/migration/v7.go b/internal/migration/v7.go index f75cbe4a..c6543c79 100644 --- a/internal/migration/v7.go +++ b/internal/migration/v7.go @@ -28,11 +28,13 @@ func migration2v7() { needOverwrite := false for _, adb := range dbList { - if adb.Name == "qqwry" && - (adb.DownloadUrls[0] == "https://99wry.cf/qqwry.dat" || - strings.Contains(adb.DownloadUrls[0], "sspanel-uim")) { - needOverwrite = true - adb.DownloadUrls = qqwry.DownloadUrls + if adb.Name == "qqwry" { + if len(adb.DownloadUrls) == 0 || + adb.DownloadUrls[0] == "https://99wry.cf/qqwry.dat" || + strings.Contains(adb.DownloadUrls[0], "sspanel-uim") { + needOverwrite = true + adb.DownloadUrls = qqwry.DownloadUrls + } } }