]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
codegen: Avoid critical in get_basic_type_info() when there is no signature
authorRico Tzschichholz <ricotz@ubuntu.com>
Tue, 15 May 2018 06:17:43 +0000 (08:17 +0200)
committerRico Tzschichholz <ricotz@ubuntu.com>
Mon, 21 May 2018 16:19:54 +0000 (18:19 +0200)
https://bugzilla.gnome.org/show_bug.cgi?id=729517

codegen/valagvariantmodule.vala

index 8d80e972b46d9df677046424bd08eb66bbebe557..3fa5ab50738a455ebf43aa7baa00405f4b6cf5ec 100644 (file)
@@ -61,11 +61,13 @@ public class Vala.GVariantModule : GAsyncModule {
                return symbol.get_attribute_string ("DBus", "signature");
        }
 
-       bool get_basic_type_info (string signature, out BasicTypeInfo basic_type) {
-               foreach (BasicTypeInfo info in basic_types) {
-                       if (info.signature == signature) {
-                               basic_type = info;
-                               return true;
+       bool get_basic_type_info (string? signature, out BasicTypeInfo basic_type) {
+               if (signature != null) {
+                       foreach (BasicTypeInfo info in basic_types) {
+                               if (info.signature == signature) {
+                                       basic_type = info;
+                                       return true;
+                               }
                        }
                }
                basic_type = BasicTypeInfo ();