volume monitor: don't unref NULL

Fix a couple more cases of blindly calling g_object_unref() on the
result of a function that is documented as sometimes returning NULL.
This commit is contained in:
Ryan Lortie 2010-10-05 02:29:47 -04:00
parent a7662ef315
commit 1612a4d506

View File

@ -49,7 +49,8 @@ do_volume_tests (GDrive *drive, GVolume *volume)
d = g_volume_get_drive (volume);
g_assert (d == drive);
g_object_unref (d);
if (d != NULL)
g_object_unref (d);
mount = g_volume_get_mount (volume);
if (mount != NULL)
@ -126,7 +127,8 @@ test_volumes (void)
drive = g_volume_get_drive (volume);
do_volume_tests (drive, volume);
g_object_unref (drive);
if (drive != NULL)
g_object_unref (drive);
}
g_list_foreach (volumes, (GFunc)g_object_unref, NULL);