summaryrefslogtreecommitdiff
path: root/src/SMAPI/Framework/ModLoading/Rewriters
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2020-10-17 22:03:43 -0400
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2020-10-17 22:03:43 -0400
commit1cac3892848bef50a58b07c567f551974635b6d8 (patch)
tree2822c151d74b237c3c3d268661c2b03d67b78ffa /src/SMAPI/Framework/ModLoading/Rewriters
parente20d26adcf7276c7f12ab9ab6ea0311953aa5194 (diff)
downloadSMAPI-1cac3892848bef50a58b07c567f551974635b6d8.tar.gz
SMAPI-1cac3892848bef50a58b07c567f551974635b6d8.tar.bz2
SMAPI-1cac3892848bef50a58b07c567f551974635b6d8.zip
fix error in heuristic rewriting
Diffstat (limited to 'src/SMAPI/Framework/ModLoading/Rewriters')
-rw-r--r--src/SMAPI/Framework/ModLoading/Rewriters/HeuristicFieldRewriter.cs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/SMAPI/Framework/ModLoading/Rewriters/HeuristicFieldRewriter.cs b/src/SMAPI/Framework/ModLoading/Rewriters/HeuristicFieldRewriter.cs
index ca04205c..f59a6ab1 100644
--- a/src/SMAPI/Framework/ModLoading/Rewriters/HeuristicFieldRewriter.cs
+++ b/src/SMAPI/Framework/ModLoading/Rewriters/HeuristicFieldRewriter.cs
@@ -68,7 +68,7 @@ namespace StardewModdingAPI.Framework.ModLoading.Rewriters
private bool TryRewriteToProperty(ModuleDefinition module, Instruction instruction, FieldReference fieldRef, TypeDefinition declaringType, bool isRead)
{
// get equivalent property
- PropertyDefinition property = declaringType.Properties.FirstOrDefault(p => p.Name == fieldRef.Name);
+ PropertyDefinition property = declaringType?.Properties.FirstOrDefault(p => p.Name == fieldRef.Name);
MethodDefinition method = isRead ? property?.GetMethod : property?.SetMethod;
if (method == null)
return false;