[vala/0.54] vala: Avoid critical in SourceFile.get_mapped_length()



commit 726580af6ed60a73a97369c46272568d5837edde
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]