diff --git a/icu4c/source/common/ucharstrie.cpp b/icu4c/source/common/ucharstrie.cpp index 4c48323c9176..0e6e0852e9c2 100644 --- a/icu4c/source/common/ucharstrie.cpp +++ b/icu4c/source/common/ucharstrie.cpp @@ -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(); }