Prevent crash when app.getDb() returns null