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

Commit fbd3572

Browse files
committed
Fix protection init
1 parent 2f06dc8 commit fbd3572

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
//51
1+
//53
22
//
33
// This code was generated by a tool. Any changes made manually will be lost
44
// the next time this code is regenerated.
55
//
66

77
using System.Reflection;
88

9-
[assembly: AssemblyFileVersion("1.13.7.51")]
10-
[assembly: AssemblyVersion("1.13.7.51")]
9+
[assembly: AssemblyFileVersion("1.13.7.53")]
10+
[assembly: AssemblyVersion("1.13.7.53")]

EssentialsPlugin/Utility/Protection.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ public void RegisterGridHandlers()
4242
{
4343
foreach ( var item in PluginSettings.Instance.ProtectedItems )
4444
{
45-
var grid = MyEntities.GetEntityById( item.EntityId ) as MyCubeGrid;
46-
if ( grid == null )
45+
MyCubeGrid grid;
46+
if (!MyEntities.TryGetEntityById(item.EntityId, out grid) || grid == null )
4747
{
4848
Essentials.Log.Error( $"Error getting entity in Protection.RegisterGridHandlers. ID: {item.EntityId}" );
4949
continue;

0 commit comments

Comments
 (0)