if(db != null) is bogus, use if(!clientCore.killedDatabase()), which is the modern equivalent: Have we loaded the client layer from disk?
Can be called twice, this is OK.
Clarify: We are interested in whether the database has been loaded.