There are a few other places where this arises in 2.2.9. Someone should probably go through all of the changes in 2.2.9 and change any tests on strings to use ?? or === instead.
Thank you for reporting this issue, it has now been resolved. We are aiming to include any changes that have been made in a future XF release (2.2.11).
Change log:
Properly account for falsy values in wholeWordTrim and snippetString functions