PepperDash / Essentials

The Essentials Application Framework Libraries
MIT License
132 stars 79 forks source link

[BUG]-Zoom room throws a null exception if layout position feedback type doesn't exist #512

Closed alex-johnson closed 3 years ago

alex-johnson commented 3 years ago

Describe the bug Get a null reference exception when switching to strip layout, since it returns a layout position of "Down" which isn't in the list of acceptable layout positions.

Stacktrace

[15:45:06.000]App 3:[zoom-1] Error Deserializing feedback: Newtonsoft.Json.JsonSerializationException: Error setting value to 'Position' on 'PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom.zConfiguration+Layout'. ---> Crestron.SimplSharp.Reflection.TargetInvocationException: TargetInvocationException ---> System.NullReferenceException: NullReferenceException
   at PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom.ZoomRoom.<get_SelfviewPipPositionFeedbackFunc>b__61()
   at PepperDash.Essentials.Core.StringFeedback.FireUpdate()
   at PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom.ZoomRoom.<SetUpFeedbackActions>b__77(Object o, PropertyChangedEventArgs a)
   at PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom.NotifiableObject.NotifyPropertyChanged(String propertyName)
   at PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom.zConfiguration.Layout.set_Position(eLayoutPosition value)
   at System.Reflection.RuntimeMethodInfo.InternalInvoke(RuntimeMethodInfo rtmi, Object obj, BindingFlags invokeAttr, Binder binder, Object parameters, CultureInfo culture, Boolean isBinderDefault, Assembly caller, Boolean verifyAccess, StackCrawlMark& stackMark)
   at System.Reflection.RuntimeMethodInfo.InternalInvoke(Object
andrew-welker commented 3 years ago

The solution here is going to be to return Unknown if the position doesn't exist in the list.