Fix a crash when we can't connect to PG

MSP-11061

No Postgres, no cry
Merge pull request #3673 from jlee-r7/bug/MSP-11061/crash-without-postgres

Fix a crash when we can't connect to PG