pidgin/plugins/vvconfig.c

branch
release-2.x.y
changeset 40926
d10bb378f560
parent 40718
5201d33e8999
--- a/pidgin/plugins/vvconfig.c	Thu Jun 03 19:31:56 2021 -0500
+++ b/pidgin/plugins/vvconfig.c	Thu Jun 03 19:33:07 2021 -0500
@@ -254,7 +254,13 @@
 	devices = get_element_devices(value);
 	if (g_list_find_custom(devices, purple_prefs_get_string(pref),
 			(GCompareFunc)strcmp) == NULL)
-		purple_prefs_set_string(pref, g_list_next(devices)->data);
+	{
+		GList *next = g_list_next(devices);
+
+		if(next != NULL) {
+			purple_prefs_set_string(pref, next->data);
+		}
+	}
 	widget = pidgin_prefs_dropdown_from_list(parent,
 			label, PURPLE_PREF_STRING,
 			pref, devices);
@@ -292,7 +298,12 @@
 	devices = get_element_devices(purple_prefs_get_string(plugin_pref));
 	if (g_list_find_custom(devices, purple_prefs_get_string(device_pref),
 			(GCompareFunc) strcmp) == NULL)
-		purple_prefs_set_string(device_pref, g_list_next(devices)->data);
+	{
+		GList *next = g_list_next(devices);
+		if(next != NULL) {
+			purple_prefs_set_string(device_pref, next->data);
+		}
+	}
 	widget = pidgin_prefs_dropdown_from_list(vbox, device_label,
 			PURPLE_PREF_STRING, device_pref, devices);
 	g_list_free(devices);

mercurial