[Mono-bugs] [Bug 661542] New: TimeZoneInfo.ConvertTime() throws NullReferenceException

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Mon Dec 27 17:07:52 EST 2010


https://bugzilla.novell.com/show_bug.cgi?id=661542

https://bugzilla.novell.com/show_bug.cgi?id=661542#c0


           Summary: TimeZoneInfo.ConvertTime() throws
                    NullReferenceException
    Classification: Mono
           Product: Mono: Class Libraries
           Version: 2.8.x
          Platform: x86-64
        OS/Version: openSUSE 11.0
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: Sys.Core
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: post-christian at freenet.de
         QAContact: mono-bugs at lists.ximian.com
                CC: post-christian at freenet.de
          Found By: Development
           Blocker: ---


Description of Problem:

converting times between some (not all) time zones is throwing an exception.

Steps to reproduce the problem:

the following code reproduces the problem

DateTime dt = new DateTime( 2000, 1, 1, 0, 0, 0, DateTimeKind.Utc );
TimeZoneInfo tzi = TimeZoneInfo.FindSystemTimeZoneById( "Pacific/Nauru" );
dt = TimeZoneInfo.ConvertTimeFromUtc( dt, tzi );
Console.WriteLine( dt.ToString( "R" ) );
TimeZoneInfo tzi2 = TimeZoneInfo.FindSystemTimeZoneById( "Pacific/Chatham" );
dt = TimeZoneInfo.ConvertTime( dt, tzi, tzi2 );
Console.WriteLine( dt.ToString( "R" ) );

Actual Results:

Sat, 01 Jan 2000 12:00:00 GMT

Unhandled Exception: System.NullReferenceException: Object reference not set to
an instance of an object
  at System.TimeZoneInfo.IsInvalidTime (DateTime dateTime) [0x00029] in
/root/install/mono-2.8.1/mcs/class/System.Core/System/TimeZoneInfo.cs:660
  at System.TimeZoneInfo.ConvertTime (DateTime dateTime, System.TimeZoneInfo
sourceTimeZone, System.TimeZoneInfo destinationTimeZone) [0x00046] in
/root/install/mono-2.8.1/mcs/class/System.Core/System/TimeZoneInfo.cs:177
  at PHPS.Test.Run (PHPS.State state) [0x00041] in
/home/christian/Windows/D/Projekte/c#/PHPS/console/source/Program.cs:54
  at PHPS.Program.Main (System.String[] args) [0x00c1e] in
/home/christian/Windows/D/Projekte/c#/PHPS/console/source/Program.cs:354

Expected Results:

a valid time

How often does this happen? 

every time

-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the mono-bugs mailing list