[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



           Summary: TimeZoneInfo.ConvertTime() throws
    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
  at System.TimeZoneInfo.ConvertTime (DateTime dateTime, System.TimeZoneInfo
sourceTimeZone, System.TimeZoneInfo destinationTimeZone) [0x00046] in
  at PHPS.Test.Run (PHPS.State state) [0x00041] in
  at PHPS.Program.Main (System.String[] args) [0x00c1e] in

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