Added error message in event bus subcription func.

This commit is contained in:
Ulysse Cura 2026-08-16 14:25:08 +02:00
parent 4995e0757b
commit 11258031c2
1 changed files with 5 additions and 1 deletions

View File

@ -110,7 +110,11 @@ int event_bus_publish(size_t id, void *arg)
int event_bus_subscribe(size_t id, callback_t callback, void *data)
{
elem_t *topic_elem = linked_list_get_if(&game.event_bus.topics, condition_is_topic_id, &id);
if(!topic_elem) return_failure_int;
if(!topic_elem)
{
error_printf("Topic with id : %lu doesn't exists.", id);
return EXIT_FAILURE;
}
topic_t *topic = topic_elem->data;