1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-06 06:32:56 +01:00

Guard against null pointer in macos_str_decomp_to_precomp()

This commit is contained in:
Richard Jenkins
2017-05-22 13:14:00 +01:00
committed by Michael Steenbeek
parent ab75b8db84
commit 493bb62457

View File

@@ -137,6 +137,10 @@ utf8* macos_str_decomp_to_precomp(utf8 *input)
{
@autoreleasepool
{
if (input == NULL) {
return NULL;
}
NSString *inputDecomp = [NSString stringWithUTF8String:input];
return strdup([inputDecomp.precomposedStringWithCanonicalMapping cStringUsingEncoding:NSUTF8StringEncoding]);
}