Skip to content

Commit

Permalink
Fix crash with empty MOTD
Browse files Browse the repository at this point in the history
  • Loading branch information
Jimmacle committed Jul 26, 2017
1 parent 72c673c commit d587e41
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Essentials 1.5.1
* Fixes
- Fixed crash if the MOTD field is empty

# Essentials 1.5
* Features
- Added MOTD
Expand Down
4 changes: 2 additions & 2 deletions Essentials/EssentialsPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

namespace Essentials
{
[Plugin("Essentials", "1.5", "cbfdd6ab-4cda-4544-a201-f73efa3d46c0")]
[Plugin("Essentials", "1.5.1", "cbfdd6ab-4cda-4544-a201-f73efa3d46c0")]
public class EssentialsPlugin : TorchPluginBase, IWpfPlugin
{
public EssentialsConfig Config => _config?.Data;
Expand Down Expand Up @@ -59,7 +59,7 @@ private void MotdOnce(MyEntity obj)
if (obj is MyCharacter character)
{
var id = character.ControllerInfo?.ControllingIdentityId ?? 0;
if (_motdOnce.Contains(id))
if (string.IsNullOrEmpty(Config.Motd) || _motdOnce.Contains(id))
return;

Torch.Multiplayer.SendMessage(Config.Motd, "MOTD", id);
Expand Down

0 comments on commit d587e41

Please sign in to comment.