Merge pull request #1860 from saper/tz-fix
authorMarcos Henrich <marcoshenrich@gmail.com>
Thu, 2 Jul 2015 14:06:16 +0000 (15:06 +0100)
committerMarcos Henrich <marcoshenrich@gmail.com>
Thu, 2 Jul 2015 14:06:16 +0000 (15:06 +0100)
[corlib] Assume UTC if no $TZ set. Fixes #30698.

mcs/class/corlib/System/TimeZoneInfo.cs

index 717bfa77c76f088a90578bb57be795b567fda494..6babee889ca384c087d538644829ade8c5fdfee8 100644 (file)
@@ -116,11 +116,11 @@ namespace System
 
                        try {
                                return FindSystemTimeZoneByFileName ("Local", "/etc/localtime");        
-                       } catch {
+                       } catch (TimeZoneNotFoundException) {
                                try {
                                        return FindSystemTimeZoneByFileName ("Local", Path.Combine (TimeZoneDirectory, "localtime"));   
-                               } catch {
-                                       return null;
+                               } catch (TimeZoneNotFoundException) {
+                                       return Utc;
                                }
                        }
                }