Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/mcs/class
diff options
context:
space:
mode:
authorGonzalo Paniagua Javier <gonzalo.mono@gmail.com>2010-07-10 01:37:39 +0400
committerGonzalo Paniagua Javier <gonzalo.mono@gmail.com>2010-07-10 01:37:39 +0400
commit4fd1ce43725c39829ba963e947d43e7d39d4f8cf (patch)
treedd2c6afc39882bf7bba60a7eabb50b325920a882 /mcs/class
parent7365be1f630e5583efd27aaab86762a739f4a0d4 (diff)
2010-07-09 Gonzalo Paniagua Javier <gonzalo@novell.com>
* TimeZoneInfo.cs: avoid nullref when there are no adjustment rules. Fixes bug #619811. svn path=/branches/mono-2-6/mcs/; revision=160158
Diffstat (limited to 'mcs/class')
-rw-r--r--mcs/class/System.Core/System/TimeZoneInfo.cs14
1 files changed, 8 insertions, 6 deletions
diff --git a/mcs/class/System.Core/System/TimeZoneInfo.cs b/mcs/class/System.Core/System/TimeZoneInfo.cs
index 0f5889ed958..6190a0a2356 100644
--- a/mcs/class/System.Core/System/TimeZoneInfo.cs
+++ b/mcs/class/System.Core/System/TimeZoneInfo.cs
@@ -729,12 +729,14 @@ namespace System
if (dateTime.Kind == DateTimeKind.Utc && this != TimeZoneInfo.Utc)
date = date + BaseUtcOffset;
- foreach (AdjustmentRule rule in adjustmentRules) {
- if (rule.DateStart > date.Date)
- return null;
- if (rule.DateEnd < date.Date)
- continue;
- return rule;
+ if (adjustmentRules != null) {
+ foreach (AdjustmentRule rule in adjustmentRules) {
+ if (rule.DateStart > date.Date)
+ return null;
+ if (rule.DateEnd < date.Date)
+ continue;
+ return rule;
+ }
}
return null;
}