diff --git a/EssentialsPlugin/AssemblyFileVersion.cs b/EssentialsPlugin/AssemblyFileVersion.cs index 3ac7385..1cb055a 100644 --- a/EssentialsPlugin/AssemblyFileVersion.cs +++ b/EssentialsPlugin/AssemblyFileVersion.cs @@ -1,4 +1,4 @@ -//51 +//53 // // This code was generated by a tool. Any changes made manually will be lost // the next time this code is regenerated. @@ -6,5 +6,5 @@ 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")] diff --git a/EssentialsPlugin/Utility/Protection.cs b/EssentialsPlugin/Utility/Protection.cs index 608d6a0..36144ad 100644 --- a/EssentialsPlugin/Utility/Protection.cs +++ b/EssentialsPlugin/Utility/Protection.cs @@ -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;