         for (sql, args) in queries {
             if !run(db, sql: sql, args: args) {
                 return false
+            }
+        }
+        return true
+    }
+
+    func runValidQueries(db: SQLiteDBConnection, queries: [(String?, Args?)]) -> Bool {
+        for (sql, args) in queries {
+            if let sql = sql {
+                if !run(db, sql: sql, args: args) {
+                    return false
+                }
             }
         }
         return true

    }

    func getDomainsTableCreationString(forVersion version: Int = BrowserTable.DefaultVersion) -> String? {
        if version > 5 {
            return "CREATE TABLE IF NOT EXISTS \(TableDomains) (" +
                "id INTEGER PRIMARY KEY AUTOINCREMENT, " +
                "domain TEXT NOT NULL UNIQUE, " +
                "showOnTopSites TINYINT NOT NULL DEFAULT 1" +
            ")"
        }
        return nil
    }

    func getQueueTableCreationString(forVersion version: Int = BrowserTable.DefaultVersion) -> String? {
        if version > 4 {
            return "CREATE TABLE IF NOT EXISTS \(TableQueuedTabs) (" +
                "url TEXT NOT NULL UNIQUE, " +
                "title TEXT" +
            ") "
        }
        return nil
    }



                ("ALTER TABLE \(TableHistory) ADD COLUMN domain_id INTEGER REFERENCES \(TableDomains)(id) ON DELETE CASCADE", nil)
            ]

            if !self.runValidQueries(db, queries: queries) {
                return false
            }

