fix when handling jsonpatch: nullcheck for session