Prevent JS error in getNativeRange()

When no range is passed, but there is also no native
selection, we would fall through and use a null range
in places where a non-null range was expected. Return
null in this case instead.

There is a larger problem where programmatically moving
the selection to a slug doesn't work (see bug), this
was just one symptom of it.

Bug: 72258
Bug: 72259
Change-Id: I0f2486af8d92803eb8dae36bcdfe1b3f540119bd
Merge "Prevent JS error in getNativeRange()"