Skip to content

Commit 615d344

Browse files
committed
Gracefully handle missining resp2 and resp3 responses (#189)
Signed-off-by: Madelyn Olson <madelyneolson@gmail.com>
1 parent c703f42 commit 615d344

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

templates/command-page.html

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,12 @@
7575
{% set_global resp2_replies = load_data(path="../_data/resp2_replies.json", required=false) -%}
7676
{% set_global resp3_replies = load_data(path="../_data/resp3_replies.json", required=false) -%}
7777
{% if resp2_replies and resp3_replies -%}
78-
{% set resp2_reply = resp2_replies | get(key=command_title) | join(sep="\n\n") -%}
79-
{% set resp3_reply = resp3_replies | get(key=command_title) | join(sep="\n\n") -%}
78+
{% set resp2_reply = resp2_replies | get(key=command_title, default="") -%}
79+
{% set resp3_reply = resp3_replies | get(key=command_title, default="") -%}
8080

81-
{% if resp2_reply or resp3_reply -%}
81+
{% if resp2_reply and resp2_reply != "" and resp3_reply and resp3_reply != "" -%}
82+
{% set resp2_reply = resp2_reply | join(sep="\n\n") -%}
83+
{% set resp3_reply = resp3_reply | join(sep="\n\n") -%}
8284
{% if resp2_reply == resp3_reply -%}
8385
<h3>RESP2/RESP3 Reply</h3>
8486
{{ commands::fix_links(content=resp2_reply) | markdown | safe }}

0 commit comments

Comments
 (0)