Fix RichTextLabel crash with out of bound exception
Fixes #68242.
I am not completely sure how the _find_list method works :sweat_smile: This check will stop the error from happening, but perhaps the iteration itself is not valid now. We are iterating over list and prev_item and then using the index to access frame->lines, and I'm not sure if that process is correct. If this fix should be implemented differently, please let me know :smile:
None of your builds seem to have to pass. Please do a rebase and try building it locally again to see if this is even valid.
Rebase done, but I can see the warnings. I'll check if I can do something about them next week.
error: comparison of integers of different signs: 'int' and 'unsigned int'
is the error you're getting.
While this would fix the crash, I'm not sure why we arrive in this state in the first place. It feels like there is some underlying problem (and of course the reported issue is completely artificial, which might be the reason for this weird state).
But if @bruvzg approves, I think we can merge it as is.
Thanks!
Cherry-picked for 4.0.1.