From 4c0c7d2b7ce722ab8c70df17ebed487acc3ff980 Mon Sep 17 00:00:00 2001 From: Ben Maurer Date: Mon, 4 Apr 2005 19:23:07 +0000 Subject: [PATCH] 2005-04-04 Ben Maurer * Thread.cs: Do argument checking for Current[UI]Culture to make the exception more clear for a null value being set. svn path=/trunk/mcs/; revision=42535 --- mcs/class/corlib/System.Threading/ChangeLog | 5 +++++ mcs/class/corlib/System.Threading/Thread.cs | 12 ++++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/mcs/class/corlib/System.Threading/ChangeLog b/mcs/class/corlib/System.Threading/ChangeLog index 9917ee2fbaf..09f7b851a86 100644 --- a/mcs/class/corlib/System.Threading/ChangeLog +++ b/mcs/class/corlib/System.Threading/ChangeLog @@ -1,3 +1,8 @@ +2005-04-04 Ben Maurer + + * Thread.cs: Do argument checking for Current[UI]Culture to make + the exception more clear for a null value being set. + 2005-03-24 Sebastien Pouliot * CompressedStack.cs: Added LinkDemand for UnmanagedCode and ECMA diff --git a/mcs/class/corlib/System.Threading/Thread.cs b/mcs/class/corlib/System.Threading/Thread.cs index 1b354a20027..cecf2cc31c2 100755 --- a/mcs/class/corlib/System.Threading/Thread.cs +++ b/mcs/class/corlib/System.Threading/Thread.cs @@ -372,6 +372,9 @@ namespace System.Threading [SecurityPermission (SecurityAction.Demand, ControlThread=true)] set { in_currentculture = true; + + if (value == null) + throw new ArgumentNullException ("value"); try { BinaryFormatter bf = new BinaryFormatter(); @@ -380,8 +383,7 @@ namespace System.Threading SetCachedCurrentCulture (value); SetSerializedCurrentCulture (ms.GetBuffer ()); - } - finally { + } finally { in_currentculture = false; } } @@ -439,6 +441,9 @@ namespace System.Threading set { in_currentculture = true; + + if (value == null) + throw new ArgumentNullException ("value"); try { BinaryFormatter bf = new BinaryFormatter(); @@ -447,8 +452,7 @@ namespace System.Threading SetCachedCurrentUICulture (value); SetSerializedCurrentUICulture (ms.GetBuffer ()); - } - finally { + } finally { in_currentculture = false; } } -- 2.11.4.GIT