From 6ce15c4265d3813ee311756ec03c6e4da74c1dbd Mon Sep 17 00:00:00 2001 From: Jeremy Kerr Date: Thu, 5 Apr 2007 13:59:29 +1000 Subject: [PATCH 1/1] Don't crash when ID_BUS isn't in the env. Signed-off-by: Jeremy Kerr --- devices/udev-helper.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/devices/udev-helper.c b/devices/udev-helper.c index 1db8a26..6a9a42b 100644 --- a/devices/udev-helper.c +++ b/devices/udev-helper.c @@ -372,6 +372,8 @@ enum generic_icon_type guess_device_type(void) const char *bus = getenv("ID_BUS"); if (type && streq(type, "cd")) return ICON_TYPE_OPTICAL; + if (!bus) + return ICON_TYPE_UNKNOWN; if (streq(bus, "usb")) return ICON_TYPE_USB; if (streq(bus, "ata") || streq(bus, "scsi")) -- 2.39.2