Skip to content

Commit 37d8168

Browse files
committed
fix parse error in query
1 parent 2cd3d89 commit 37d8168

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

OpenFlow/src/DatabaseConnection.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ export class DatabaseConnection {
8484
query = JSON.parse(json, (key, value) => {
8585
if (typeof value === 'string' && value.match(isoDatePattern)) {
8686
return new Date(value); // isostring, so cast to js date
87-
} else if (value.toString().indexOf("__REGEXP ") == 0) {
87+
} else if (value != null && value != undefined && value.toString().indexOf("__REGEXP ") == 0) {
8888
var m = value.split("__REGEXP ")[1].match(/\/(.*)\/(.*)?/);
8989
return new RegExp(m[1], m[2] || "");
9090
} else
@@ -170,7 +170,7 @@ export class DatabaseConnection {
170170
query = JSON.parse(json, (key, value) => {
171171
if (typeof value === 'string' && value.match(isoDatePattern)) {
172172
return new Date(value); // isostring, so cast to js date
173-
} else if (value.toString().indexOf("__REGEXP ") == 0) {
173+
} else if (value != null && value != undefined && value.toString().indexOf("__REGEXP ") == 0) {
174174
var m = value.split("__REGEXP ")[1].match(/\/(.*)\/(.*)?/);
175175
return new RegExp(m[1], m[2] || "");
176176
} else

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.0.117
1+
0.0.118

0 commit comments

Comments
 (0)