]> Nutra Git (v2) - gamesguru/feather.git/commitdiff
fix file close cache bug
authorgg <chown_tee@proton.me>
Mon, 12 Jan 2026 13:59:57 +0000 (08:59 -0500)
committergg <chown_tee@proton.me>
Mon, 12 Jan 2026 13:59:57 +0000 (08:59 -0500)
src/model/WalletKeysFilesModel.cpp

index 58bc703c6c18ef95a346ee073aa3fc66dcb47667..fc85eaa97964836a9464603da9825a9d8dde9bf8 100644 (file)
@@ -97,18 +97,19 @@ void WalletKeysFilesModel::findWallets() {
 
         if (Utils::fileExists(basePath + ".address.txt")) {
             QFile file(basePath + ".address.txt");
-            if (!file.open(QFile::ReadOnly | QFile::Text))
-                continue;
-            const QString _address = QString::fromUtf8(file.readAll());
-
-            if (!_address.isEmpty()) {
-                addr = _address;
-                if (addr.startsWith("5") || addr.startsWith("7"))
-                    networkType = NetworkType::STAGENET;
-                else if (addr.startsWith("9") || addr.startsWith("B"))
-                    networkType = NetworkType::TESTNET;
+            if (file.open(QFile::ReadOnly | QFile::Text)) {
+                const QString _address = QString::fromUtf8(file.readAll());
+
+                if (!_address.isEmpty()) {
+                    addr = _address;
+                    if (addr.startsWith("5") || addr.startsWith("7"))
+                        networkType = NetworkType::STAGENET;
+                    else if (addr.startsWith("9") || addr.startsWith("B"))
+                        networkType = NetworkType::TESTNET;
+                }
+                file.close();
             }
-            file.close();
+            // If file can't be opened, just proceed without the cached address
         }
 
         this->addWalletKeysFile(WalletKeysFile(fileInfo, networkType, std::move(addr)));