* add check for `cwldsession == null` at the start of that function.
cwldsession == nullat the start of that function.