Fix NPE when doing a new deployment with an uninitialized db