Skip to content

Commit

Permalink
Add null checks to MobileAuthenticatedStream to avoid null reference …
Browse files Browse the repository at this point in the history
…exception

When attached with the native debugger, it does not allow you to continue past the native signal raised due to the null refrence exception.
  • Loading branch information
martinpotter committed Oct 26, 2021
1 parent 702eea3 commit 70abe56
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -725,6 +725,9 @@ internal AsyncOperationStatus ProcessHandshake (AsyncOperationStatus status, boo
internal (int ret, bool wantMore) ProcessRead (BufferOffsetSize userBuffer)
{
lock (ioLock) {
if (xobileTlsContext == null)
return (0, false);

// This operates on the internal buffer and will never block.
if (operation != Operation.Authenticated)
throw GetInternalError ();
Expand All @@ -740,6 +743,9 @@ internal AsyncOperationStatus ProcessHandshake (AsyncOperationStatus status, boo
internal (int ret, bool wantMore) ProcessWrite (BufferOffsetSize userBuffer)
{
lock (ioLock) {
if (xobileTlsContext == null)
return (0, false);

// This operates on the internal buffer and will never block.
if (operation != Operation.Authenticated)
throw GetInternalError ();
Expand Down

0 comments on commit 70abe56

Please sign in to comment.