From 51b889c6ef24d9b21f42c40193cea4a67ffb4cb2 Mon Sep 17 00:00:00 2001 From: Sara Date: Wed, 22 Nov 2023 15:12:32 +0100 Subject: [PATCH] added ASSERT_RETURN to playerinput constructor --- core/src/player_input.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/src/player_input.c b/core/src/player_input.c index d8220f8..55d1efc 100644 --- a/core/src/player_input.c +++ b/core/src/player_input.c @@ -1,7 +1,9 @@ #include "player_input.h" +#include "debug.h" PlayerInput* playerinput_new(void* target, int device) { PlayerInput* self = malloc(sizeof(PlayerInput)); + ASSERT_RETURN(self != NULL, NULL, "Could not allocate memory for PlayerInput instance"); self->listeners = list_from_type(InputListener); self->device = input_get_device_by_id(device); self->target = target;