[vala/staging] vala: Avoid critical in SourceFile.get_mapped_length()
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/staging] vala: Avoid critical in SourceFile.get_mapped_length()
- Date: Tue, 14 Jun 2022 10:49:39 +0000 (UTC)
commit 05b7ed117d79da7b3d22d76c7a49d96a6a958031
Author: Rico Tzschichholz <ricotz ubuntu com>
Date: Tue Jun 14 12:43:16 2022 +0200
vala: Avoid critical in SourceFile.get_mapped_length()
See https://gitlab.gnome.org/GNOME/vala/issues/1330
vala/valasourcefile.vala | 4 ++++
1 file changed, 4 insertions(+)
---
diff --git a/vala/valasourcefile.vala b/vala/valasourcefile.vala
index 9d8808038..8f4175cde 100644
--- a/vala/valasourcefile.vala
+++ b/vala/valasourcefile.vala
@@ -362,6 +362,10 @@ public class Vala.SourceFile {
return content.length;
}
+ if (mapped_file == null) {
+ return 0;
+ }
+
return mapped_file.get_length ();
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]