From 2897c7ad92756248a1c3d097f2d326ca4c1c8d69 Mon Sep 17 00:00:00 2001 From: MysterD Date: Wed, 8 Nov 2023 14:15:35 -0800 Subject: [PATCH] Fix crash in djui_inputbox_on_text_input() --- data/dynos_mgr_anim.cpp | 2 ++ src/pc/djui/djui_inputbox.c | 1 + 2 files changed, 3 insertions(+) diff --git a/data/dynos_mgr_anim.cpp b/data/dynos_mgr_anim.cpp index 472ffdc0..e6a22a6a 100644 --- a/data/dynos_mgr_anim.cpp +++ b/data/dynos_mgr_anim.cpp @@ -40,6 +40,8 @@ static s32 RetrieveCurrentAnimationIndex(struct Object *aObject) { // Must be called twice, before and after geo_set_animation_globals void DynOS_Anim_Swap(void *aPtr) { + if (!aPtr) { return; } + static Animation *pDefaultAnimation = NULL; static Animation sGfxDataAnimation; diff --git a/src/pc/djui/djui_inputbox.c b/src/pc/djui/djui_inputbox.c index b2adb87f..dffeae09 100644 --- a/src/pc/djui/djui_inputbox.c +++ b/src/pc/djui/djui_inputbox.c @@ -317,6 +317,7 @@ void djui_inputbox_on_focus_end(UNUSED struct DjuiBase* base) { } void djui_inputbox_on_text_input(struct DjuiBase *base, char* text) { + if (!base || !text) { return; } struct DjuiInputbox *inputbox = (struct DjuiInputbox *) base; char* msg = inputbox->buffer; int msgLen = strlen(msg);