aboutsummaryrefslogtreecommitdiff
path: root/hw/qdev-properties.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/qdev-properties.c')
-rw-r--r--hw/qdev-properties.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/qdev-properties.c b/hw/qdev-properties.c
index c4fb15c..5c627fa 100644
--- a/hw/qdev-properties.c
+++ b/hw/qdev-properties.c
@@ -208,7 +208,7 @@ static int parse_drive(DeviceState *dev, Property *prop, const char *str)
static int print_drive(DeviceState *dev, Property *prop, char *dest, size_t len)
{
DriveInfo **ptr = qdev_get_prop_ptr(dev, prop);
- return snprintf(dest, len, "%s", (*ptr)->id);
+ return snprintf(dest, len, "%s", (*ptr) ? (*ptr)->id : "<null>");
}
PropertyInfo qdev_prop_drive = {