[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.
This commit is contained in:
Joren Van Onder 2015-08-10 11:16:18 +02:00 committed by Christophe Simonis
parent 59b5f136bf
commit 7c4864e942
1 changed files with 2 additions and 0 deletions

View File

@ -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()