diff --git a/advagg_js_compress/jshrink.inc b/advagg_js_compress/jshrink.inc
index b92d4fd3c..5c0699fc0 100644
--- a/advagg_js_compress/jshrink.inc
+++ b/advagg_js_compress/jshrink.inc
@@ -225,7 +225,7 @@ class Minifier
                 // new lines
                 case "\n":
                     // if the next line is something that can't stand alone preserve the newline
-                    if (strpos('(-+[@', $this->b) !== false) {
+                    if ($this->b && strpos('(-+[@', $this->b) !== false) {
                         echo $this->a;
                         $this->saveString();
                         break;
