mirror of https://github.com/koreader/koreader
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 commitreviewable/pr8425/r17a0e3d5e68
("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:7a0e3d5e68
("readerhighlight: remove selected_word and use selected_text everywhere") Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
parent
7baeebc2d4
commit
3fd931bb2f
Loading…
Reference in New Issue