diff --git a/Boss/Mod/SwapManager.cpp b/Boss/Mod/SwapManager.cpp index 22467a9c1..f4a7b5c91 100644 --- a/Boss/Mod/SwapManager.cpp +++ b/Boss/Mod/SwapManager.cpp @@ -280,6 +280,8 @@ class SwapManager::Impl { /* First, try to get an address from the addrcache. */ auto check = tx.query(R"QRY( SELECT id, address FROM "SwapManager_addrcache" + WHERE address IS NOT NULL + AND address <> '' ORDER BY id LIMIT 1 ; @@ -626,12 +628,14 @@ class SwapManager::Impl { auto address = std::string(); for (auto& r : fetch) address = r.get(0); - tx.query(R"QRY( - INSERT INTO "SwapManager_addrcache" - VALUES(NULL, :address); - )QRY") - .bind(":address", address) - .execute(); + if (!address.empty()) { + tx.query(R"QRY( + INSERT INTO "SwapManager_addrcache" + VALUES(NULL, :address); + )QRY") + .bind(":address", address) + .execute(); + } /* Delete the swap itself. */ tx.query(R"QRY(