fixed _getDB on database initialisation failure

Seems logical fix for me.

@dom-mel did you had a reason for not yet merging this into the master?