Catch Z-BUS errors in templates.
[citadel.git] / webcit / subst.c
index 586f4f8c646df6b156107b9b25451c2892fed9e0..83540918a1e7c45f9dfadfeb06933561804d3cc8 100644 (file)
@@ -679,6 +679,7 @@ void StrBufAppendTemplate(StrBuf *Target,
        char EscapeAs = ' ';
 
        if ((FormatTypeIndex < TP->Tokens->nParameters) &&
+           (TP->Tokens->Params[FormatTypeIndex] != NULL) &&
            (TP->Tokens->Params[FormatTypeIndex]->Type == TYPE_STR) &&
            (TP->Tokens->Params[FormatTypeIndex]->len >= 1)) {
                pFmt = TP->Tokens->Params[FormatTypeIndex]->Start;