diff --git a/lib/parser.js b/lib/parser.js
index <HASH>..<HASH> 100644
--- a/lib/parser.js
+++ b/lib/parser.js
@@ -199,11 +199,11 @@ exports.parse_calendar = function(data, timezone) {
     var state = expect("BEGIN", "VCALENDAR", parse_component(calendar));
 
     for(var i=0; i<data.length-1; ++i) {
-        if(state === undefined)
-            throw new ParseError("Mismatched BEGIN/END tags");
-
         if(!data[i].length)
             continue;
+            
+        if(state === undefined)
+            throw new ParseError("Mismatched BEGIN/END tags");
 
         // Peek ahead to find line continuations...
         var j = i;
Be more tolerant of new lines when parsing.

No longer throws errors when empty blank lines are added to the end of a
vcalendar string to parse.