]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
vala: Avoid critical in SourceFile.get_mapped_length()
authorRico Tzschichholz <ricotz@ubuntu.com>
Tue, 14 Jun 2022 10:43:16 +0000 (12:43 +0200)
committerRico Tzschichholz <ricotz@ubuntu.com>
Wed, 10 Aug 2022 17:10:59 +0000 (19:10 +0200)
See https://gitlab.gnome.org/GNOME/vala/issues/1330

vala/valasourcefile.vala

index 826925bfd9e3ac6943bb77be80874472a75bc01c..5f5822629d2f62e1831bd16ee73d985925858dfb 100644 (file)
@@ -362,6 +362,10 @@ public class Vala.SourceFile {
                        return content.length;
                }
 
+               if (mapped_file == null) {
+                       return 0;
+               }
+
                return mapped_file.get_length ();
        }