Skip to content

Commit

Permalink
fix: Adds check to print error message if any panel order value is se…
Browse files Browse the repository at this point in the history
…t to 0.
  • Loading branch information
ndorin committed Sep 25, 2024
1 parent 9a177cc commit c6c2017
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/UserInterface/UserInterfaceExtensions/Panels/Panel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ public class Panel : ICiscoCodecUiExtensionsPanel
internal void OnClickedEvent() { ClickedEvent?.Invoke(this, EventArgs.Empty); }

/// <summary>
/// Determines the order of the panels. Values are 1-9999. 0 is not valid. Lower numbers are displayed first.
/// <!-- 1-9999 -->
/// Determines the order of the panels. Lower numbers are displayed first.
/// </summary>
/// <remarks>Valid values are 1-9999. 0 is not valid.</remarks>
[XmlElement("Order")]
[JsonProperty("order")]
public ushort Order { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,13 @@ public PanelsHandler(IKeyed parent, Action<string> enqueueCommand, List<Panel> c
"No Cisco Panels Configured {0}", _parent, config);
return;
}
else if (config.Any((p) => p.Order == 0))
{
Debug.LogMessage(Serilog.Events.LogEventLevel.Error,
"0 is an invalid order value. Must be >= 1 {0}. PanelHandler will not be registered. Please update order values in config.", _parent, config);
return;
}

RegisterFeedback();
}

Expand Down

0 comments on commit c6c2017

Please sign in to comment.