PepperDash / Essentials

The Essentials Application Framework Libraries
MIT License
133 stars 77 forks source link

[BUG]-EssentialsRoomEmergencyContactClosure constructor null ref #1071

Closed jkdevito closed 1 year ago

jkdevito commented 1 year ago

Was this bug identified in a specific build version? Essentials 1.12.8

Describe the bug Essentials room throws a null reference exception when instantiating EssentialsRoomEmergencyContactClosure.

Stacktrace

[08:51:40.503]App 1:[room1] Error Initializing Room: System.NullReferenceException: Object reference not set to an instance of an object.
  at PepperDash.Essentials.Room.EssentialsRoomEmergencyContactClosure..ctor (System.String key, PepperDash.Essentials.Room.Config.EssentialsRoomEmergencyConfig config, PepperDash.Essentials.Core.IEssentialsRoom room) [0x0001f] in <8bcd68ebc41445c69aaeaa414a87a67d>:0
  at PepperDash.Essentials.Room.Config.EssentialsRoomConfigHelper.GetEmergency (PepperDash.Essentials.Room.Config.EssentialsRoomPropertiesConfig props, PepperDash.Essentials.Core.IEssentialsRoom room) [0x00020] in <8bcd68ebc41445c69aaeaa414a87a67d>:0
  at PepperDash.Essentials.EssentialsHuddleVtc1Room.InitializeRoom () [0x00141] in <8bcd68ebc41445c69aaeaa414a87a67d>:0

To Reproduce Steps to reproduce the behavior:

  1. Load standalone Essentials config with emergency object defined
  2. Load Essentials 1.12.8
  3. Null reference exception is thrown on startup

Additional context Found when testing a system with a Portal-generated config using tool v1.4.0. Looking further into Essentials, it appears the room.Emergency object is null when passed into the EssentialsRoomEmergencyContactClosure constructor.

jkdevito commented 1 year ago

Closing issue. Further testing exposed issues with the Portal config tool not unmerging data correctly. Update applied to Portal config tool, and retested using Essentials 1.12.8.