Skip to content

Commit

Permalink
Fixed possible crash
Browse files Browse the repository at this point in the history
  • Loading branch information
vchelaru committed Jan 6, 2024
1 parent 64655ae commit 2deca10
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ public PositionedObject CreateEntity(string entityNameGameType, int currentAddOb
if (ScreenManager.IsInEditMode)
{
var entityType = this.GetType().Assembly.GetType(entityNameGameType);
var hasBeenLoadedProperty = entityType.GetProperty("HasBeenLoadedWithGlobalContentManager");
var hasBeenLoadedProperty = entityType?.GetProperty("HasBeenLoadedWithGlobalContentManager");
if (hasBeenLoadedProperty != null)
{
var hasBeenLoaded = (bool)hasBeenLoadedProperty.GetValue(null);
Expand Down

0 comments on commit 2deca10

Please sign in to comment.