Skip to content
This repository has been archived by the owner on May 28, 2022. It is now read-only.

Commit

Permalink
Fix segmentation fault when no USB devices detected
Browse files Browse the repository at this point in the history
Signed-off-by: Thanh Ha <[email protected]>
  • Loading branch information
zxiiro committed Aug 30, 2013
1 parent c1b0bbb commit e20ebdd
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/freeseer/plugins/videoinput/usbsrc/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,9 @@ def __init__(self):
super(USBSrc, self).__init__()

# Initialize a default device if there is None
if self.device is None:
self.device = self.get_devices().itervalues().next();
devices = self.get_devices();
if devices and self.device is None:
self.device = devices.itervalues().next();

def get_videoinput_bin(self):
"""
Expand Down

0 comments on commit e20ebdd

Please sign in to comment.