CopyListOfCommandNamesWithDynamic(&SortedCommandList, &SortedCommandListSize);\r
\r
for (CurrentCommand = SortedCommandList \r
- ; CurrentCommand != NULL && *CurrentCommand != CHAR_NULL && CurrentCommand < SortedCommandList + SortedCommandListSize/sizeof(CHAR16)\r
+ ; CurrentCommand != NULL && CurrentCommand < SortedCommandList + SortedCommandListSize/sizeof(CHAR16) && *CurrentCommand != CHAR_NULL\r
; CurrentCommand += StrLen(CurrentCommand) + 1\r
) {\r
//\r