Skip to content

Commit d91d95e

Browse files
davidLeonardigkorland
authored andcommitted
Don't break when values are null (#20)
* Don't break when values are null running .toString on null throws an error. This mitigates the error.
1 parent 17725ca commit d91d95e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/record.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,12 @@ class Record {
2020
if (typeof key === "string") {
2121
index = this._header.indexOf(key);
2222
}
23-
return this._values[index].toString();
23+
24+
if (this._values[index]) {
25+
return this._values[index].toString();
26+
}
27+
28+
return null;
2429
}
2530

2631
keys() {

0 commit comments

Comments
 (0)