[Mono-bugs] [Bug 588708] RegionInfo.CurrentRegion should not return null

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Wed Mar 31 01:46:58 EDT 2010


http://bugzilla.novell.com/show_bug.cgi?id=588708

http://bugzilla.novell.com/show_bug.cgi?id=588708#c6


Miguel de Icaza <miguel at novell.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |aenomoto at novell.com,
                   |                            |miguel at novell.com
           Severity|Normal                      |Major

--- Comment #6 from Miguel de Icaza <miguel at novell.com> 2010-03-31 05:46:57 UTC ---
I tried this with Mono 2.6.1 and this does not crash with the default
environment, I suspect this happens when some sort of environment is not
configured in the way that Mono expects it.

The code was originally written by Atsushi, and the only case where it can
return a null is if the "current culture is invariant, so the region is not
available".    

It seems like somehow we should be initializing the Current culture first, but
I am not sure where this should be done.

Atsushi, this is some 5 year old code, so I am not sure that you will remember,
could you shed some light if you remember?

This is the code:

// This property is not synchronized with CurrentCulture, so
// we need to use bootstrap CurrentCulture LCID.
public static RegionInfo CurrentRegion {
    get {
        if (currentRegion == null) {
            // make sure to fill BootstrapCultureID.
            CultureInfo ci = CultureInfo.CurrentCulture;
            // If current culture is invariant then region is not available.
            if (ci == null || CultureInfo.BootstrapCultureID == 0x7F)
                return null;
            currentRegion = new RegionInfo (CultureInfo.BootstrapCultureID);
        }
        return currentRegion;
    }
}

-- 
Configure bugmail: http://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