Fix null deref in selection reading
Fix null deref in selection reading

FIX: Fix an issue where reading the selection from the DOM might crash in
non-editable mode.

Issue prosemirror/prosemirror#828

ProseMirror/prosemirror-view