[retro-gtk] environment: Log a critical when getting a variable failed



commit 39ad15bd5a298b85cd3ad9597411a1cbd765ceed
Author: Adrien Plazas <kekun plazas laposte net>
Date:   Thu Dec 17 19:29:29 2020 +0100

    environment: Log a critical when getting a variable failed

 retro-runner/retro-environment.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/retro-runner/retro-environment.c b/retro-runner/retro-environment.c
index d2ba2a0..167db52 100644
--- a/retro-runner/retro-environment.c
+++ b/retro-runner/retro-environment.c
@@ -285,8 +285,11 @@ get_variable (RetroCore     *self,
 
   value = g_hash_table_lookup (self->variables, variable->key);
 
-  if (!value)
+  if (G_UNLIKELY (!value)) {
+    g_critical ("Couldn't get variable %s", variable->key);
+
     return FALSE;
+  }
 
   variable->value = value;
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]