Fix panics from unicode slicing in license detection (#38015)

Closes #37954

Release Notes:

- N/A
7655e22ff5Michael Sloan committed on 9/11/2025, 7:57:24 PM· committed by GitHubparent7a83a7f
1 file changedLine totals unavailable