summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Zeuthen <davidz@redhat.com>2011-08-16 13:05:13 -0400
committerDavid Zeuthen <davidz@redhat.com>2011-08-16 13:05:13 -0400
commit26c65488cd7f893a836b6be0b8a4609ec3c02e14 (patch)
tree522940aefb1277d6a1f18086b9054053586831ea
parentbebb0c9adcd57045dee71408ae756cf6532568e8 (diff)
Don't dereference a NULL pointer
Signed-off-by: David Zeuthen <davidz@redhat.com>
-rw-r--r--src/udiskslinuxdriveobject.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/udiskslinuxdriveobject.c b/src/udiskslinuxdriveobject.c
index 2874429..29e9520 100644
--- a/src/udiskslinuxdriveobject.c
+++ b/src/udiskslinuxdriveobject.c
@@ -401,9 +401,12 @@ udisks_linux_drive_object_get_device (UDisksLinuxDriveObject *object,
{
GUdevDevice *ret;
/* TODO: actually look at @get_hw */
- ret = object->devices->data;
- if (ret != NULL)
- g_object_ref (ret);
+ if (object->devices != NULL)
+ {
+ ret = object->devices->data;
+ if (ret != NULL)
+ g_object_ref (ret);
+ }
return ret;
}