shared/timeout-glib: Check 0 id when removing timeout
If the id is 0 that makes it is invalid already.
diff --git a/src/shared/timeout-glib.c b/src/shared/timeout-glib.c
index 4163bce..fd71ca4 100644
--- a/src/shared/timeout-glib.c
+++ b/src/shared/timeout-glib.c
@@ -71,8 +71,12 @@
void timeout_remove(unsigned int id)
{
- GSource *source = g_main_context_find_source_by_id(NULL, id);
+ GSource *source;
+ if (!id)
+ return;
+
+ source = g_main_context_find_source_by_id(NULL, id);
if (source)
g_source_destroy(source);
}