From 9e0aa2b730a7fd83a81aa21998a79ae46ad922d7 Mon Sep 17 00:00:00 2001 From: MysterD Date: Wed, 8 Nov 2023 13:20:10 -0800 Subject: [PATCH] Fixed crash in get_id_from_behavior_name() --- data/behavior_table.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/behavior_table.c b/data/behavior_table.c index 2f8c3684..f541e419 100644 --- a/data/behavior_table.c +++ b/data/behavior_table.c @@ -589,7 +589,7 @@ const char* get_behavior_name_from_id(enum BehaviorId id) { enum BehaviorId get_id_from_behavior_name(const char* name) { for (enum BehaviorId i = 0; i < id_bhv_max_count; i++) { - if (!strcmp(name, gBehaviorTable[i].name)) { + if (gBehaviorTable[i].name && !strcmp(name, gBehaviorTable[i].name)) { return i; } }