From 9551dddbb82ef2991f201e2da4de887afa0cf9d7 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Wed, 26 Sep 2018 15:13:34 +1000 Subject: [PATCH] tools: handle NULL svgs in ratbag-command Showed up in #526 https://github.com/libratbag/libratbag/issues/526#issuecomment-420016451 --- tools/ratbagc.py.in | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/ratbagc.py.in b/tools/ratbagc.py.in index d5f047e2..0df9b1ef 100644 --- a/tools/ratbagc.py.in +++ b/tools/ratbagc.py.in @@ -292,7 +292,11 @@ class RatbagdDevice(metaclass=MetaRatbag): @param theme The theme from which to retrieve the SVG, as str """ - return os.path.join(LIBRATBAG_DATA_DIR, theme, libratbag.ratbag_device_get_svg_name(self._device)) + svg = libratbag.ratbag_device_get_svg_name(self._device) + if svg is None: + return '' + + return os.path.join(LIBRATBAG_DATA_DIR, theme, svg) def get_svg_fd(self, theme): """Returns a File-like object to the SVG for the given theme, or