Skip to content
This repository was archived by the owner on Jan 23, 2024. It is now read-only.

Commit 095dfe4

Browse files
committed
add error checking to sql queries
1 parent 3e178bb commit 095dfe4

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/firefox/components/fathom.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1610,8 +1610,9 @@ FathomAPI.prototype = {
16101610
try {
16111611
var q1 = "SELECT * FROM endhost ORDER BY id DESC LIMIT 1";
16121612
var statement = db.createStatement(q1);
1613-
statement.executeStep();
1614-
data = statement.getString(1);
1613+
if (statement.executeStep()) {
1614+
data = statement.getString(1);
1615+
}
16151616
} catch(e) {
16161617
dump(e);
16171618
} finally {
@@ -4015,8 +4016,9 @@ FathomAPI.prototype = {
40154016
try {
40164017
var q1 = "SELECT * FROM endhost ORDER BY id DESC LIMIT 1";
40174018
var statement = db.createStatement(q1);
4018-
statement.executeStep();
4019+
if (statement.executeStep()) {
40194020
data = statement.getString(1);
4021+
}
40204022
} catch(e) {
40214023
dump(e);
40224024
} finally {

src/firefox/dist/fathom.xpi

3 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)