]> 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>
Tue, 14 Jun 2022 10:49:22 +0000 (12:49 +0200)
See https://gitlab.gnome.org/GNOME/vala/issues/1330

vala/valasourcefile.vala

index 9d8808038aec2c31be133d502ceb92a40a6d7bc3..8f4175cdef7d1ecb4932d5b505b9de958a5b2218 100644 (file)
@@ -362,6 +362,10 @@ public class Vala.SourceFile {
                        return content.length;
                }
 
+               if (mapped_file == null) {
+                       return 0;
+               }
+
                return mapped_file.get_length ();
        }