Can Node.resolve return falsey?

Look at the source for prosemirror-view, I was surprised by two lines in eventHandlers.drop:

  let $mouse = view.state.doc.resolve(eventPos.pos)
  if (!$mouse) return

My understanding is that Node.resolve would throw, rather than return null. Is that conditional return redundant?

Not trying to be picky - just in the spirit of learning.

Yes, it is redundant—probably a holdover from when this worked differently. I’ve removed that statement.

1 Like