]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
libvaladoc/girimporter: Fallback to "glib:type-name" for class, interface and record
authorRico Tzschichholz <ricotz@ubuntu.com>
Mon, 24 Aug 2020 15:03:43 +0000 (17:03 +0200)
committerRico Tzschichholz <ricotz@ubuntu.com>
Sat, 5 Sep 2020 14:42:41 +0000 (16:42 +0200)
This caused criticals like:

  valadoc_importer_gir_documentation_importer_attach_comment: assertion 'cname != NULL' failed

libvaladoc/importer/girdocumentationimporter.vala

index 9a9d98b09b7b7956e8c28fb4bd5c7aef32ad8a32..1ce11b39c07ba245c22ae8cd095ae4218b5f0dc8 100644 (file)
@@ -486,6 +486,9 @@ public class Valadoc.Importer.GirDocumentationImporter : DocumentationImporter {
        private void parse_record () {
                start_element ("record");
                this.parent_c_identifier = reader.get_attribute ("c:type");
+               if (this.parent_c_identifier == null) {
+                       this.parent_c_identifier = reader.get_attribute ("glib:type-name");
+               }
                if (this.parent_c_identifier.has_suffix ("Private")) {
                        this.parent_c_identifier = null;
                        skip_element ();
@@ -525,6 +528,9 @@ public class Valadoc.Importer.GirDocumentationImporter : DocumentationImporter {
        private void parse_class () {
                start_element ("class");
                this.parent_c_identifier = reader.get_attribute ("c:type");
+               if (this.parent_c_identifier == null) {
+                       this.parent_c_identifier = reader.get_attribute ("glib:type-name");
+               }
                next ();
 
                Api.GirSourceComment? comment = parse_symbol_doc ();
@@ -565,6 +571,9 @@ public class Valadoc.Importer.GirDocumentationImporter : DocumentationImporter {
        private void parse_interface () {
                start_element ("interface");
                this.parent_c_identifier = reader.get_attribute ("c:type");
+               if (this.parent_c_identifier == null) {
+                       this.parent_c_identifier = reader.get_attribute ("glib:type-name");
+               }
                next ();
 
                Api.GirSourceComment? comment = parse_symbol_doc ();