diff --git a/src/hb-icu.cc b/src/hb-icu.cc index 52645fd64412d739e37e128c9a8a90fea0eb43f9..9b94a94f318da049ba5905c972e5385a452c709f 100644 --- a/src/hb-icu.cc +++ b/src/hb-icu.cc @@ -157,6 +157,9 @@ hb_icu_get_script (hb_unicode_funcs_t *ufuncs, UErrorCode status = U_ZERO_ERROR; UScriptCode scriptCode = uscript_getScript(unicode, &status); + if (unlikely (status != U_ZERO_ERROR)) + return HB_SCRIPT_UNKNOWN; + return hb_icu_script_to_script (scriptCode); }