Fix crash when no device folders are present