iOS 8 GM lists "Asia/Chita" among its time zones, but when requesting
the time zone data for that time zone, no data is returned.
With this change we ignore time zones without any data when fetching
all the timezones on the system.
[DllImport ("__Internal")]
extern static IntPtr monotouch_timezone_get_data (string name, ref int size);
- static Stream GetMonoTouchData (string name)
+ static Stream GetMonoTouchData (string name, bool throw_on_error = true)
{
int size = 0;
IntPtr data = monotouch_timezone_get_data (name, ref size);
- if (size <= 0)
- throw new TimeZoneNotFoundException ();
+ if (size <= 0) {
+ if (throw_on_error)
+ throw new TimeZoneNotFoundException ();
+ return null;
+ }
unsafe {
var s = new UnmanagedMemoryStream ((byte*) data, size);
#elif MONOTOUCH
if (systemTimeZones.Count == 0) {
foreach (string name in GetMonoTouchNames ()) {
- using (Stream stream = GetMonoTouchData (name)) {
+ using (Stream stream = GetMonoTouchData (name, false)) {
+ if (stream == null)
+ continue;
systemTimeZones.Add (BuildFromStream (name, stream));
}
}