From 60237f4d39eef619d030bd8f3334a13cbd2caffe Mon Sep 17 00:00:00 2001
From: Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com>
Date: Wed, 7 Nov 2018 02:07:23 -0500
Subject: fix error if peer.GetMod is called on a peer who doesn't have SMAPI
 (#480)

---
 src/SMAPI/Framework/Networking/MultiplayerPeer.cs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'src/SMAPI/Framework')

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();
-- 
cgit