Skip to content

Commit 67adf9a

Browse files
authored
Merge pull request #21 from pahan35/fix-null-processing
Fix null processing in QuoteString
2 parents cac5977 + 8affb2a commit 67adf9a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/quoteString.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ function QuoteString(string) {
1010
return QuoteString(string.toString());
1111
}
1212
return string.toString();
13-
}
13+
} else if (string === null) {
14+
return 'null';
15+
}
1416
string = string.toString();
1517
string = string.replace(/\\/g, '\\\\');
1618
string = string.replace('\x00', '\\x00');
@@ -20,4 +22,4 @@ function QuoteString(string) {
2022
return "'" + string + "'";
2123
}
2224

23-
module.exports = QuoteString;
25+
module.exports = QuoteString;

0 commit comments

Comments
 (0)