Skip to content

Commit a3d5d99

Browse files
committed
Fixed a bug that caused parseStringArray() to not support empty arrays
1 parent b93ecbe commit a3d5d99

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

lib/textParsers.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ var parseStringArray = function(val) {
6060
throw "Not postgresql array! (" + arrStr + ")";
6161

6262
var x = val.substring(1, val.length - 1);
63+
if (x === '') return [];
6364
x = x.match(/(NULL|[^,]+|"((?:.|\n|\r)*?)(?!\\)"|\{((?:.|\n|\r)*?(?!\\)\}) (,|$))/mg);
6465
if (x === null) throw "Not postgre array";
6566
return x.map(function (el) {

0 commit comments

Comments
 (0)