From 306fe44cc101b1888ccf10f8e02cb7d7d39d9732 Mon Sep 17 00:00:00 2001 From: antiduh Date: Tue, 1 Jul 2014 18:32:44 +0000 Subject: [PATCH] Added more disposed checks. --- NSspi/Contexts/Context.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/NSspi/Contexts/Context.cs b/NSspi/Contexts/Context.cs index e763e26..a955a1f 100644 --- a/NSspi/Contexts/Context.cs +++ b/NSspi/Contexts/Context.cs @@ -110,6 +110,10 @@ namespace NSspi.Contexts { throw new InvalidOperationException( "The context is not fully formed." ); } + else if( this.Disposed ) + { + throw new ObjectDisposedException( "Context" ); + } sizes = QueryBufferSizes(); @@ -186,6 +190,10 @@ namespace NSspi.Contexts { throw new InvalidOperationException( "The context is not fully formed." ); } + else if( this.Disposed ) + { + throw new ObjectDisposedException( "Context" ); + } sizes = QueryBufferSizes();