1
0
Fork 0
mirror of https://gitlab.gnome.org/GNOME/calls.git synced 2024-06-30 15:49:31 +00:00

calls-call: Fix crash with null call state

Account for having a null (zero) call state in
calls_call_state_to_string.  This fixes a crash as a result of the
recent UI changes.
This commit is contained in:
Bob Ham 2019-07-01 15:02:08 +01:00
parent eaba235e0b
commit 5937874c44

View file

@ -38,7 +38,14 @@ calls_call_state_to_string (GString *string,
GEnumValue *value;
klass = g_type_class_ref (CALLS_TYPE_CALL_STATE);
value = g_enum_get_value (klass, (gint)state);
if (!value)
{
return g_string_printf (string,
"Unknown call state (%d)",
(gint)state);
}
g_string_assign (string, value->value_nick);
string->str[0] = g_ascii_toupper (string->str[0]);