diff --git a/Minecraft-Realms-Emulator/Modes/External/WorldsController.cs b/Minecraft-Realms-Emulator/Modes/External/WorldsController.cs index f8ca150..df7fb94 100644 --- a/Minecraft-Realms-Emulator/Modes/External/WorldsController.cs +++ b/Minecraft-Realms-Emulator/Modes/External/WorldsController.cs @@ -73,8 +73,8 @@ namespace Minecraft_Realms_Emulator.Modes.External OwnerUUID = world.OwnerUUID, Name = world.Name, Motd = world.Motd, - GameMode = activeSlot.GameMode, - IsHardcore = activeSlot.Difficulty == 3, + GameMode = activeSlot?.GameMode ?? 0, + IsHardcore = activeSlot?.Difficulty == 3, State = world.State, WorldType = world.WorldType, MaxPlayers = world.MaxPlayers, @@ -177,8 +177,8 @@ namespace Minecraft_Realms_Emulator.Modes.External OwnerUUID = world.OwnerUUID, Name = world.Name, Motd = world.Motd, - GameMode = activeSlot.GameMode, - IsHardcore = activeSlot.Difficulty == 3, + GameMode = activeSlot?.GameMode ?? 0, + IsHardcore = activeSlot?.Difficulty == 3, State = world.State, WorldType = world.WorldType, MaxPlayers = world.MaxPlayers, @@ -333,8 +333,8 @@ namespace Minecraft_Realms_Emulator.Modes.External OwnerUUID = world.OwnerUUID, Name = world.Name, Motd = world.Motd, - GameMode = activeSlot.GameMode, - IsHardcore = activeSlot.Difficulty == 3, + GameMode = activeSlot?.GameMode ?? 0, + IsHardcore = activeSlot?.Difficulty == 3, State = world.State, WorldType = world.WorldType, MaxPlayers = world.MaxPlayers, diff --git a/Minecraft-Realms-Emulator/Modes/Realms/Controllers/WorldsController.cs b/Minecraft-Realms-Emulator/Modes/Realms/Controllers/WorldsController.cs index e2eaafd..18ce045 100644 --- a/Minecraft-Realms-Emulator/Modes/Realms/Controllers/WorldsController.cs +++ b/Minecraft-Realms-Emulator/Modes/Realms/Controllers/WorldsController.cs @@ -76,8 +76,8 @@ namespace Minecraft_Realms_Emulator.Modes.Realms.Controllers OwnerUUID = world.OwnerUUID, Name = world.Name, Motd = world.Motd, - GameMode = activeSlot.GameMode, - IsHardcore = activeSlot.Difficulty == 3, + GameMode = activeSlot?.GameMode ?? 0, + IsHardcore = activeSlot?.Difficulty == 3, State = world.State, WorldType = world.WorldType, MaxPlayers = world.MaxPlayers, @@ -180,8 +180,8 @@ namespace Minecraft_Realms_Emulator.Modes.Realms.Controllers OwnerUUID = world.OwnerUUID, Name = world.Name, Motd = world.Motd, - GameMode = activeSlot.GameMode, - IsHardcore = activeSlot.Difficulty == 3, + GameMode = activeSlot?.GameMode ?? 0, + IsHardcore = activeSlot?.Difficulty == 3, State = world.State, WorldType = world.WorldType, MaxPlayers = world.MaxPlayers, @@ -336,8 +336,8 @@ namespace Minecraft_Realms_Emulator.Modes.Realms.Controllers OwnerUUID = world.OwnerUUID, Name = world.Name, Motd = world.Motd, - GameMode = activeSlot.GameMode, - IsHardcore = activeSlot.Difficulty == 3, + GameMode = activeSlot?.GameMode ?? 0, + IsHardcore = activeSlot?.Difficulty == 3, State = world.State, WorldType = world.WorldType, MaxPlayers = world.MaxPlayers,