Fix error print on an undefined value when a database does not have lock defined. Thanks to Csaba Toth for the report.