diff --git a/examples/null_string.html b/examples/null_string.html
new file mode 100644
index 0000000..12bcb08
--- /dev/null
+++ b/examples/null_string.html
@@ -0,0 +1,5 @@
+Hello {{name}}
+glytch {{glytch}}
+binary {{binary}}
+value {{value}}
+numeric {{numeric}}
\ No newline at end of file
diff --git a/examples/null_string.js b/examples/null_string.js
new file mode 100644
index 0000000..93414a1
--- /dev/null
+++ b/examples/null_string.js
@@ -0,0 +1,9 @@
+var null_string = {
+ name: "Elise",
+ glytch: true,
+ binary: false,
+ value: null,
+ numeric: function() {
+ return NaN;
+ }
+};
diff --git a/examples/null_string.txt b/examples/null_string.txt
new file mode 100644
index 0000000..827569b
--- /dev/null
+++ b/examples/null_string.txt
@@ -0,0 +1,5 @@
+Hello Elise
+glytch true
+binary false
+value
+numeric NaN
diff --git a/mustache.js b/mustache.js
index e356521..5f6a601 100644
--- a/mustache.js
+++ b/mustache.js
@@ -194,7 +194,7 @@ var Mustache = function() {
Does away with nasty characters
*/
escape: function(s) {
- return (s ? s.toString() : "").replace(/[&"<>\\]/g, function(s) {
+ return ((s == null) ? "" : s).toString().replace(/[&"<>\\]/g, function(s) {
switch(s) {
case "&": return "&";
case "\\": return "\\\\";;