From 7c4864e942d31b3f43af092e272ed2ab7e1c8a21 Mon Sep 17 00:00:00 2001 From: Joren Van Onder Date: Mon, 10 Aug 2015 11:16:18 +0200 Subject: [PATCH] [FIX] hw_scanner: don't try to grab() a non-existing device This would generate an ERROR entry in the log every 5 seconds as long as no barcode scanner is plugged in. --- addons/hw_scanner/controllers/main.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/hw_scanner/controllers/main.py b/addons/hw_scanner/controllers/main.py index bcad8b92906..8e5e8f6af18 100644 --- a/addons/hw_scanner/controllers/main.py +++ b/addons/hw_scanner/controllers/main.py @@ -172,6 +172,8 @@ class Scanner(Thread): else: time.sleep(5) # wait until a suitable device is plugged device = self.get_device() + if not device: + continue try: device.grab()