summaryrefslogtreecommitdiff
path: root/src/SMAPI
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2018-11-07 02:07:23 -0500
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2018-11-07 02:07:23 -0500
commit60237f4d39eef619d030bd8f3334a13cbd2caffe (patch)
tree537efc758d588a7c517ce36ac355b885edec5e6e /src/SMAPI
parent6a1994b850b30889459e650629ed9e1357e8abac (diff)
downloadSMAPI-60237f4d39eef619d030bd8f3334a13cbd2caffe.tar.gz
SMAPI-60237f4d39eef619d030bd8f3334a13cbd2caffe.tar.bz2
SMAPI-60237f4d39eef619d030bd8f3334a13cbd2caffe.zip
fix error if peer.GetMod is called on a peer who doesn't have SMAPI (#480)
Diffstat (limited to 'src/SMAPI')
-rw-r--r--src/SMAPI/Framework/Networking/MultiplayerPeer.cs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/SMAPI/Framework/Networking/MultiplayerPeer.cs b/src/SMAPI/Framework/Networking/MultiplayerPeer.cs
index e703dbb1..7f0fa4f7 100644
--- a/src/SMAPI/Framework/Networking/MultiplayerPeer.cs
+++ b/src/SMAPI/Framework/Networking/MultiplayerPeer.cs
@@ -112,7 +112,7 @@ namespace StardewModdingAPI.Framework.Networking
/// <returns>Returns the mod info, or <c>null</c> if the player doesn't have that mod.</returns>
public IMultiplayerPeerMod GetMod(string id)
{
- if (string.IsNullOrWhiteSpace(id))
+ if (string.IsNullOrWhiteSpace(id) || this.Mods == null || !this.Mods.Any())
return null;
id = id.Trim();