bugfix to safely deal with server exception resulting in null document