Skip to content

Commit

Permalink
added null check to ReadMemory
Browse files Browse the repository at this point in the history
  • Loading branch information
erfg12 committed Jan 25, 2022
1 parent 036274b commit 111dc56
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Memory/Methods/Read.cs
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,10 @@ public T ReadMemory<T>(string address, string file = "")
break;
}

return (T) Convert.ChangeType(ReadOutput, typeof(T));
if (ReadOutput != null)
return (T)Convert.ChangeType(ReadOutput, typeof(T));
else
return default(T);
}

ConcurrentDictionary<string, CancellationTokenSource> ReadTokenSrcs = new ConcurrentDictionary<string, CancellationTokenSource>();
Expand Down

0 comments on commit 111dc56

Please sign in to comment.