fix NullPointerException in Device.getName()