1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-04-25 22:17:45 +00:00

Make sure modifiers exist before deserializing

This commit is contained in:
Lucy 2023-01-28 21:13:29 +01:00
parent 419012f6e5
commit e036a69cf9

View file

@ -32,7 +32,8 @@ namespace Sapphire::World::Action
inline void from_json( const nlohmann::json& j, StatusEntry& statusEntry )
{
j.at( "id" ).get_to( statusEntry.id );
j.at( "modifiers" ).get_to( statusEntry.modifiers );
if( j.contains( "modifiers" ) )
j.at( "modifiers" ).get_to( statusEntry.modifiers );
}
inline void from_json( const nlohmann::json& j, ActionEntry& action )