mirror of
https://gitlab.gnome.org/GNOME/calls.git
synced 2024-11-19 01:51:46 +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:
parent
eaba235e0b
commit
5937874c44
1 changed files with 7 additions and 0 deletions
|
@ -38,7 +38,14 @@ calls_call_state_to_string (GString *string,
|
||||||
GEnumValue *value;
|
GEnumValue *value;
|
||||||
|
|
||||||
klass = g_type_class_ref (CALLS_TYPE_CALL_STATE);
|
klass = g_type_class_ref (CALLS_TYPE_CALL_STATE);
|
||||||
|
|
||||||
value = g_enum_get_value (klass, (gint)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);
|
g_string_assign (string, value->value_nick);
|
||||||
string->str[0] = g_ascii_toupper (string->str[0]);
|
string->str[0] = g_ascii_toupper (string->str[0]);
|
||||||
|
|
Loading…
Reference in a new issue