Fix NPE if database has no configuration for a device.