summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bk_whlp.c35
1 files changed, 19 insertions, 16 deletions
diff --git a/bk_whlp.c b/bk_whlp.c
index a8cb99e..f4b1b2d 100644
--- a/bk_whlp.c
+++ b/bk_whlp.c
@@ -479,22 +479,25 @@ static void whlp_mkparagraph(struct bk_whlp_state *state,
case word_LowerXref:
if (subsidiary) break; /* disabled in subsidiary bits */
kwl = kw_lookup(state->keywords, text->text);
- assert(xref_target == NULL);
- if (kwl->para->type == para_NumberedList) {
- break; /* don't xref to numbered list items */
- } else if (kwl->para->type == para_BiblioCited) {
- /*
- * An xref to a bibliography item jumps to the section
- * containing it.
- */
- if (kwl->para->parent)
- xref_target = kwl->para->parent;
- else
- break;
- } else {
- xref_target = kwl->para;
- }
- whlp_start_hyperlink(state->h, (WHLP_TOPIC)xref_target->private_data);
+ assert(xref_target == NULL);
+ if (kwl) {
+ if (kwl->para->type == para_NumberedList) {
+ break; /* don't xref to numbered list items */
+ } else if (kwl->para->type == para_BiblioCited) {
+ /*
+ * An xref to a bibliography item jumps to the section
+ * containing it.
+ */
+ if (kwl->para->parent)
+ xref_target = kwl->para->parent;
+ else
+ break;
+ } else {
+ xref_target = kwl->para;
+ }
+ whlp_start_hyperlink(state->h,
+ (WHLP_TOPIC)xref_target->private_data);
+ }
break;
case word_XrefEnd: