diff --git a/script.js b/script.js index 1cf3c3b..b17e466 100644 --- a/script.js +++ b/script.js @@ -654,10 +654,11 @@ getAsObject() { try { if (!this._columnNames) this._columnNames = this._stmt.getColumnNames(); + const values = this._stmt.get(); const row = Object.create(null); const count = this._columnNames.length; for (let i = 0; i < count; i += 1) { - row[this._columnNames[i]] = this._stmt.get(i); + row[this._columnNames[i]] = values ? values[i] : undefined; } return row; } catch (error) {