Adds null-guard to PrintIdTree

identifiers
venko 2021-05-07 14:36:37 -07:00
parent fddacae487
commit e2bca66dc4
1 changed files with 5 additions and 0 deletions

View File

@ -127,6 +127,11 @@ void PrintIdNode(IdNode *node) {
}
void PrintIdTree(IdNode *tree, uint32_t tabCount) {
if (tree == NULL) {
fprintf(stderr, "wraith: Attempted to call PrintIdTree on a null value.\n");
return;
}
uint32_t i;
for (i = 0; i < tabCount; i++) {
printf("| ");