diff options
author | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2018-11-07 02:07:23 -0500 |
---|---|---|
committer | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2018-11-07 02:07:23 -0500 |
commit | 60237f4d39eef619d030bd8f3334a13cbd2caffe (patch) | |
tree | 537efc758d588a7c517ce36ac355b885edec5e6e /src | |
parent | 6a1994b850b30889459e650629ed9e1357e8abac (diff) | |
download | SMAPI-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')
-rw-r--r-- | src/SMAPI/Framework/Networking/MultiplayerPeer.cs | 2 |
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(); |