]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
libvaladoc/gtkdoc-importer: Don't let parse_block_taglet() return null
authorRico Tzschichholz <ricotz@ubuntu.com>
Thu, 27 Aug 2020 08:41:47 +0000 (10:41 +0200)
committerRico Tzschichholz <ricotz@ubuntu.com>
Sat, 5 Sep 2020 14:42:41 +0000 (16:42 +0200)
This caused criticals like:

  valadoc_taglets_param_set_is_c_self_param: assertion 'self != NULL' failed

libvaladoc/documentation/gtkdoccommentparser.vala

index bf3be801af5aa1dd14cd0d5bc58faf4b1e9cf0d3..cc8133d9fbb9ed8ef044423456de3b90f19d4313 100644 (file)
@@ -235,15 +235,16 @@ public class Valadoc.Gtkdoc.Parser : Object, ResourceLocator {
                var ic = parse_inline_content ();
                parse_docbook_spaces (false);
 
-               if (current.type != TokenType.EOF) {
-                       this.report_unexpected_token (current, "<EOF>");
-                       return null;
-               }
-
                BlockContent? taglet = factory.create_taglet (taglet_name) as BlockContent;
                assert (taglet != null);
                Paragraph paragraph = factory.create_paragraph ();
-               paragraph.content.add (ic);
+
+               if (current.type == TokenType.EOF) {
+                       paragraph.content.add (ic);
+               } else {
+                       this.report_unexpected_token (current, "<EOF>");
+               }
+
                taglet.content.add (paragraph);
                return taglet as Taglet;
        }