From: Florian Brosch Date: Thu, 24 Feb 2011 02:32:43 +0000 (+0100) Subject: libvaladoc: TypeReference: Add missing null checks X-Git-Tag: 0.37.1~3^2~379 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=7829d666d5d9e3466fd8ab096206400170863e4f;p=thirdparty%2Fvala.git libvaladoc: TypeReference: Add missing null checks --- diff --git a/src/libvaladoc/api/typereference.vala b/src/libvaladoc/api/typereference.vala index 8b7428b30..e7adfe87e 100644 --- a/src/libvaladoc/api/typereference.vala +++ b/src/libvaladoc/api/typereference.vala @@ -51,6 +51,10 @@ public class Valadoc.Api.TypeReference : Item { public bool pass_ownership { get { + if (this.vtyperef == null) { + return false; + } + Vala.CodeNode? node = this.vtyperef.parent_node; if (node == null) { return false; @@ -69,6 +73,10 @@ public class Valadoc.Api.TypeReference : Item { public bool is_owned { get { + if (this.vtyperef == null) { + return false; + } + Vala.CodeNode parent = this.vtyperef.parent_node; // parameter: @@ -101,7 +109,7 @@ public class Valadoc.Api.TypeReference : Item { public bool is_dynamic { get { - return this.vtyperef.is_dynamic; + return this.vtyperef != null && this.vtyperef.is_dynamic; } } @@ -123,14 +131,19 @@ public class Valadoc.Api.TypeReference : Item { public bool is_nullable { get { - return this.vtyperef.nullable + return this.vtyperef != null + && this.vtyperef.nullable && !(this.vtyperef is Vala.GenericType) && !(this.vtyperef is Vala.PointerType); } } public string? get_dbus_type_signature () { - return Vala.DBusModule.get_type_signature (vtyperef); + if (vtyperef != null) { + return Vala.DBusModule.get_type_signature (vtyperef); + } else { + return null; + } } internal override void resolve_type_references (Tree root) {