From: Rico Tzschichholz Date: Sat, 11 Mar 2017 09:34:34 +0000 (+0100) Subject: codegen: Accessor of interface-property might be absent X-Git-Tag: 0.35.90~13 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b7e86f6685236cc276826bf4a0fef0209ed69b12;p=thirdparty%2Fvala.git 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. --- diff --git a/codegen/valagtypemodule.vala b/codegen/valagtypemodule.vala index ab89c5e11..86a6474a1 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);