icu/Collate: initialize the error code before ucol_open()
Fixes initialization failure.
This commit is contained in:
parent
33fc3af775
commit
1e63e7c08b
@ -48,7 +48,7 @@ IcuCollateInit(Error &error)
|
|||||||
assert(collator == nullptr);
|
assert(collator == nullptr);
|
||||||
assert(!error.IsDefined());
|
assert(!error.IsDefined());
|
||||||
|
|
||||||
UErrorCode code;
|
UErrorCode code = U_ZERO_ERROR;
|
||||||
collator = ucol_open("", &code);
|
collator = ucol_open("", &code);
|
||||||
if (collator == nullptr) {
|
if (collator == nullptr) {
|
||||||
error.Format(icu_domain, int(code),
|
error.Format(icu_domain, int(code),
|
||||||
|
Loading…
Reference in New Issue
Block a user