mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-07-29 16:38:37 +00:00
Add null handling to SlotBase
This commit is contained in:
parent
7c1d109157
commit
9451babb76
1 changed files with 6 additions and 1 deletions
|
@ -1,4 +1,5 @@
|
|||
using System.Xml.Serialization;
|
||||
using System;
|
||||
using System.Xml.Serialization;
|
||||
using LBPUnion.ProjectLighthouse.Types.Entities.Level;
|
||||
using LBPUnion.ProjectLighthouse.Types.Entities.Token;
|
||||
using LBPUnion.ProjectLighthouse.Types.Levels;
|
||||
|
@ -50,6 +51,10 @@ public abstract class SlotBase : ILbpSerializable
|
|||
|
||||
public static SlotBase CreateFromEntity(SlotEntity slot, GameVersion targetGame, int targetUserId)
|
||||
{
|
||||
if (slot == null)
|
||||
{
|
||||
throw new Exception($"Tried to create GameSlot from null slot, targetGame={targetGame}, targetUserId={targetUserId}");
|
||||
}
|
||||
if (slot.Type == SlotType.Developer)
|
||||
{
|
||||
GameDeveloperSlot devSlot = new()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue