Skip to content
This repository has been archived by the owner on Jun 23, 2023. It is now read-only.

Commit

Permalink
Fix protection init
Browse files Browse the repository at this point in the history
  • Loading branch information
rexxar-tc committed Jul 29, 2016
1 parent 2f06dc8 commit fbd3572
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions EssentialsPlugin/AssemblyFileVersion.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
//51
//53
//
// This code was generated by a tool. Any changes made manually will be lost
// the next time this code is regenerated.
//

using System.Reflection;

[assembly: AssemblyFileVersion("1.13.7.51")]
[assembly: AssemblyVersion("1.13.7.51")]
[assembly: AssemblyFileVersion("1.13.7.53")]
[assembly: AssemblyVersion("1.13.7.53")]
4 changes: 2 additions & 2 deletions EssentialsPlugin/Utility/Protection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ public void RegisterGridHandlers()
{
foreach ( var item in PluginSettings.Instance.ProtectedItems )
{
var grid = MyEntities.GetEntityById( item.EntityId ) as MyCubeGrid;
if ( grid == null )
MyCubeGrid grid;
if (!MyEntities.TryGetEntityById(item.EntityId, out grid) || grid == null )
{
Essentials.Log.Error( $"Error getting entity in Protection.RegisterGridHandlers. ID: {item.EntityId}" );
continue;
Expand Down

0 comments on commit fbd3572

Please sign in to comment.