avoid nullptr dereference when no devices are found

Authored by rjvbb on Jun 9 2018, 12:27 PM.