[valadoc] libvaladoc/html: Fix nullptr in write_documentation



commit 1486befd45c88ff23e84852d2b605086683a18d4
Author: Florian Brosch <flo brosch gmail com>
Date:   Wed Aug 29 22:34:50 2012 +0200

    libvaladoc/html: Fix nullptr in write_documentation

 src/libvaladoc/html/basicdoclet.vala |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/src/libvaladoc/html/basicdoclet.vala b/src/libvaladoc/html/basicdoclet.vala
index 9a45a9a..5977756 100644
--- a/src/libvaladoc/html/basicdoclet.vala
+++ b/src/libvaladoc/html/basicdoclet.vala
@@ -452,8 +452,13 @@ public abstract class Valadoc.Html.BasicDoclet : Api.Visitor, Doclet {
 				if (replacement_node == null) {
 					writer.text (replacement_name);
 				} else {
-					string css = cssresolver.resolve (replacement_node);
-					writer.link (get_link (replacement_node, pos), replacement_node.get_full_name (), css);
+					string? link = get_link (replacement_node, pos);
+					if (link != null) {
+						string css = cssresolver.resolve (replacement_node);
+						writer.link (link, replacement_node.get_full_name (), css);
+					} else {
+						writer.start_tag ("code").text (replacement_node.get_full_name ()).end_tag ("code");
+					}
 				}
 				writer.text (".");
 			}
@@ -508,8 +513,7 @@ public abstract class Valadoc.Html.BasicDoclet : Api.Visitor, Doclet {
 				writer.link (linker.get_package_link (pkg, settings), pkg.name);
 				// brief description
 				writer.end_tag ("li");
-			}
-			else {
+			} else {
 				writer.start_tag ("li", {"class", cssresolver.resolve (pkg)});
 				writer.text (pkg.name);
 				writer.end_tag ("li");



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