Skip to content

Commit 352bbd6

Browse files
claudiamurialdoBeta Bot
authored andcommitted
Cherry pick branch 'genexuslabs:fix/memory-leak-ws-security' into beta
1 parent e8e924a commit 352bbd6

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

dotnet/src/dotnetframework/GxClasses/Helpers/HttpHelper.cs

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -692,20 +692,26 @@ internal static string JsonQuote(string value, bool addDoubleQuotes=false)
692692
#if !NETCORE
693693
public static void SetSoapContext(GXSOAPContext value)
694694
{
695-
RequestMessageExtension ext = OperationContext.Current.Extensions.Find<RequestMessageExtension>();
696-
if (ext == null)
695+
if (OperationContext.Current != null)
697696
{
698-
ext = new RequestMessageExtension();
699-
OperationContext.Current.Extensions.Add(ext);
697+
RequestMessageExtension ext = OperationContext.Current.Extensions.Find<RequestMessageExtension>();
698+
if (ext == null)
699+
{
700+
ext = new RequestMessageExtension();
701+
OperationContext.Current.Extensions.Add(ext);
702+
}
703+
ext.SOAPContext = value;
700704
}
701-
ext.SOAPContext = value;
702705
}
703706
internal static GXSOAPContext GetSoapContext()
704707
{
705-
RequestMessageExtension ext = OperationContext.Current.Extensions.Find<RequestMessageExtension>();
706-
if (ext != null)
708+
if (OperationContext.Current != null)
707709
{
708-
return ext.SOAPContext;
710+
RequestMessageExtension ext = OperationContext.Current.Extensions.Find<RequestMessageExtension>();
711+
if (ext != null)
712+
{
713+
return ext.SOAPContext;
714+
}
709715
}
710716
return null;
711717
}

0 commit comments

Comments
 (0)