diff options
author | Roei Erez <roeie@mono-cvs.ximian.com> | 2007-09-10 14:33:22 +0400 |
---|---|---|
committer | Roei Erez <roeie@mono-cvs.ximian.com> | 2007-09-10 14:33:22 +0400 |
commit | 0e75b3e2af75155d5d30f78809fb4c8ea7ad72e7 (patch) | |
tree | ee1a66b2b7d1e5ebfc6f2045dbcf2fbe2d110148 /mcs/class/System/System.Diagnostics/TraceListener.cs | |
parent | fec737547ee553a7100287a4d5c637d8eb8aa9ab (diff) |
fix NullPointerException when TraceOptions is not initialized
svn path=/trunk/mcs/; revision=85558
Diffstat (limited to 'mcs/class/System/System.Diagnostics/TraceListener.cs')
-rw-r--r-- | mcs/class/System/System.Diagnostics/TraceListener.cs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/mcs/class/System/System.Diagnostics/TraceListener.cs b/mcs/class/System/System.Diagnostics/TraceListener.cs index e91e2e4166c..ec83065bea4 100644 --- a/mcs/class/System/System.Diagnostics/TraceListener.cs +++ b/mcs/class/System/System.Diagnostics/TraceListener.cs @@ -81,8 +81,13 @@ namespace System.Diagnostics { set { System.Threading.Thread.SetData (_filterStore, value); } } - private TraceOptions options { - get { return (TraceOptions) System.Threading.Thread.GetData (_optionsStore); } + private TraceOptions options {
+ get {
+ object o = System.Threading.Thread.GetData (_optionsStore);
+ if (o == null)
+ return TraceOptions.None;
+ return (TraceOptions) o;
+ } set { System.Threading.Thread.SetData (_optionsStore, value); } } #endif |