readerhighlight: ignore cases where no text is selected (#8399)
readerhighlight: ignore cases where no text is selected (#8399)

It's possible for the user to have selected nothing, and trying to
operate on the nil highlight can cause confusion or crashes. This
restores the behaviour before commit 7a0e3d5e68e4 ("readerhighlight:
remove selected_word and use selected_text everywhere"), which missed
this case.

In addition, add some debug guards to ReaderHighlight methods which
cannot handle selected_text being nil (or at least, shouldn't be called
with selected_text being nil).

Fixes: 7a0e3d5e68e4 ("readerhighlight: remove selected_word and use selected_text everywhere")
Signed-off-by: Aleksa Sarai <b305c9b0212d6145eea67bbffd24e29cb79c759c@cyphar.com>
Frenzie/koreader,koreader/koreader,NiLuJe/koreader,poire-z/koreader,poire-z/koreader,Frenzie/koreader,NiLuJe/koreader,koreader/koreader