Skip to content

Commit

Permalink
Merge pull request #1215 from Unity-Technologies/fix-windows-invalid-…
Browse files Browse the repository at this point in the history
…timezone-exception

Fixing a corner case where an invalid timezone on windows would throw a
  • Loading branch information
UnityAlex authored Aug 6, 2019
2 parents 0fe7bad + 8478689 commit d349677
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion mcs/class/corlib/System/TimeZoneInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,13 @@ static TimeZoneInfo CreateLocal ()
if (string.IsNullOrEmpty(name))
name = GetLocalTimeZoneKeyNameWin32Fallback();
if (name != null)
return TimeZoneInfo.FindSystemTimeZoneById (name);
{
try{
return TimeZoneInfo.FindSystemTimeZoneById (name);
} catch (TimeZoneNotFoundException) {
return GetLocalTimeZoneInfoWinRTFallback();
}
}
} else if (IsWindows) {
return GetLocalTimeZoneInfoWinRTFallback ();
}
Expand Down

0 comments on commit d349677

Please sign in to comment.