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,6 +49,7 @@ do_volume_tests (GDrive *drive, GVolume *volume)
d = g_volume_get_drive (volume);
g_assert (d == drive);
if (d != NULL)
g_object_unref (d);
mount = g_volume_get_mount (volume);
@ -126,6 +127,7 @@ test_volumes (void)
drive = g_volume_get_drive (volume);
do_volume_tests (drive, volume);
if (drive != NULL)
g_object_unref (drive);
}