Better solution to handle no-dev platforms

This should also work fine when no platforms has devices available.