ICU-23074 Add nullptr check for UCharsTrie::next

This commit is contained in:
Burkov Egor 2025-03-13 10:11:19 +03:00
parent 30e23b0d28
commit 5fd9e2b3e5

View file

@ -177,7 +177,7 @@ UCharsTrie::next(int32_t uchar) {
UStringTrieResult
UCharsTrie::next(ConstChar16Ptr ptr, int32_t sLength) {
const char16_t *s=ptr;
if(sLength<0 ? *s==0 : sLength==0) {
if(s==nullptr || (sLength<0 ? *s==0 : sLength==0)) {
// Empty input.
return current();
}