]> git.donarmstrong.com Git - deb_pkgs/autorandr.git/blobdiff - autorandr.py
Don't fail hard in get_fb_dimensions if a mode isn't WWWxHHH
[deb_pkgs/autorandr.git] / autorandr.py
index 0c1c942b7392f6bdb7b219ba1eb8342082e038a8..cc1a25a0a40fd383c528538e075afdff581a674a 100755 (executable)
@@ -660,7 +660,10 @@ def get_fb_dimensions(configuration):
         if "off" in output.options or not output.edid:
             continue
         # This won't work with all modes -- but it's a best effort.
-        o_mode = re.search("[0-9]{3,}x[0-9]{3,}", output.options["mode"]).group(0)
+        match = re.search("[0-9]{3,}x[0-9]{3,}", output.options["mode"])
+        if not match:
+            return None
+        o_mode = match.group(0)
         o_width, o_height = map(int, o_mode.split("x"))
         if "transform" in output.options:
             a, b, c, d, e, f, g, h, i = map(float, output.options["transform"].split(","))