From 8b8e9e491963bcfdd963942e0ae0abfdf1eaf918 Mon Sep 17 00:00:00 2001 From: Asbelos Date: Thu, 12 Oct 2023 11:07:05 +0100 Subject: [PATCH] clean result from invalid --- DCCEXParser.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/DCCEXParser.cpp b/DCCEXParser.cpp index 7b4836e..04c0b6d 100644 --- a/DCCEXParser.cpp +++ b/DCCEXParser.cpp @@ -729,11 +729,15 @@ void DCCEXParser::parseOne(Print *stream, byte *com, RingStream * ringStream) SENDFLASHLIST(stream,RMFT2::rosterIdList) } else { - const FSH * functionNames= RMFT2::getRosterFunctions(id); - StringFormatter::send(stream,F(" %d \"%S\" \"%S\""), - id, RMFT2::getRosterName(id), - functionNames == NULL ? RMFT2::getRosterFunctions(0) : functionNames); - } + auto rosterName= RMFT2::getRosterName(id); + if (!rosterName) rosterName=F(""); + + auto functionNames= RMFT2::getRosterFunctions(id); + if (!functionNames) functionNames=RMFT2::getRosterFunctions(0); + if (!functionNames) functionNames=F(""); + StringFormatter::send(stream,F(" %d \"%S\" \"%S\""), + id, rosterName, functionNames); + } #endif StringFormatter::send(stream, F(">\n")); return;