[vala/0.40] codegen: Avoid critical in get_basic_type_info() when there is no signature



commit 54fcc2aa2650c0a7590938a66468405afcbf7e47
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Tue May 15 08:17:43 2018 +0200

    codegen: Avoid critical in get_basic_type_info() when there is no signature
    
    https://bugzilla.gnome.org/show_bug.cgi?id=729517

 codegen/valagvariantmodule.vala |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)
---
diff --git a/codegen/valagvariantmodule.vala b/codegen/valagvariantmodule.vala
index 8d80e97..3fa5ab5 100644
--- a/codegen/valagvariantmodule.vala
+++ b/codegen/valagvariantmodule.vala
@@ -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 ();


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]