put does not always work

There is a case when 
cfg = (SysConfig) db.session().get (SysConfig.class, name);
throws an exception and a case when it returns null.
The code update fixes this.