[vala/staging] codegen: Accessor of interface-property might be absent



commit b7e86f6685236cc276826bf4a0fef0209ed69b12
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Sat Mar 11 10:34:34 2017 +0100

    codegen: Accessor of interface-property might be absent
    
    Avoid criticals while unconditionaly trying to chain-up to non-existing
    property-accessors without checking for null.

 codegen/valagtypemodule.vala |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/codegen/valagtypemodule.vala b/codegen/valagtypemodule.vala
index ab89c5e..86a6474 100644
--- a/codegen/valagtypemodule.vala
+++ b/codegen/valagtypemodule.vala
@@ -1462,7 +1462,7 @@ public class Vala.GTypeModule : GErrorModule {
 
                                var ciface = new CCodeIdentifier ("iface");
 
-                               if (base_property.get_accessor != null) {
+                               if (base_property.get_accessor != null && prop.get_accessor != null) {
                                        generate_property_accessor_declaration (base_property.get_accessor, 
cfile);
 
                                        string cname = get_ccode_name (base_property.get_accessor);
@@ -1470,7 +1470,7 @@ public class Vala.GTypeModule : GErrorModule {
                                        cfunc = cast_property_accessor_pointer (prop.get_accessor, cfunc, 
iface);
                                        ccode.add_assignment (new CCodeMemberAccess.pointer (ciface, 
"get_%s".printf (prop.name)), cfunc);
                                }
-                               if (base_property.set_accessor != null) {
+                               if (base_property.set_accessor != null && prop.set_accessor != null) {
                                        generate_property_accessor_declaration (base_property.set_accessor, 
cfile);
 
                                        string cname = get_ccode_name (base_property.set_accessor);


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