mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-26 05:56:14 +01:00
notification: Add an assertion to clarify
Coverity doesn't see that g_enum_get_value will never return NULL here since we always pass it a valid enum value. Help it along with an assertion.
This commit is contained in:
parent
dab2097587
commit
0c12177514
@ -714,6 +714,7 @@ g_notification_get_priority_nick (GNotification *notification)
|
|||||||
|
|
||||||
enum_class = g_type_class_ref (G_TYPE_NOTIFICATION_PRIORITY);
|
enum_class = g_type_class_ref (G_TYPE_NOTIFICATION_PRIORITY);
|
||||||
value = g_enum_get_value (enum_class, g_notification_get_priority (notification));
|
value = g_enum_get_value (enum_class, g_notification_get_priority (notification));
|
||||||
|
g_assert (value != NULL);
|
||||||
nick = g_variant_new_string (value->value_nick);
|
nick = g_variant_new_string (value->value_nick);
|
||||||
g_type_class_unref (enum_class);
|
g_type_class_unref (enum_class);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user