]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Fix crash when compiling empty .vala file
authorRémy Saissy <remy.saissy@gmail.com>
Sun, 23 May 2010 10:44:16 +0000 (12:44 +0200)
committerJürg Billeter <j@bitron.ch>
Thu, 27 May 2010 21:09:12 +0000 (23:09 +0200)
Fixes bug 619422.

vala/valascanner.vala

index 420530ccb9d7ae6b36184fe01b58edc702f042dd..8099037223c0411a3a9b708896373e30a350397f 100644 (file)
@@ -1469,7 +1469,8 @@ public class Vala.Scanner {
        }
 
        bool comment (bool file_comment = false) {
-               if (current > end - 2
+               if (current == null
+                   || current > end - 2
                    || current[0] != '/'
                    || (current[1] != '/' && current[1] != '*')) {
                        return false;