Skip to content

Commit

Permalink
some defensive coding
Browse files Browse the repository at this point in the history
  • Loading branch information
joslat committed Dec 17, 2024
1 parent d1e1541 commit 55937a0
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ public static string ToMermaid(this ProcessBuilder processBuilder, int maxLevel
/// <returns></returns>
public static string ToMermaid(this KernelProcess process, int maxLevel = 2)
{
// Check that the maximum level is at least 1
if (maxLevel < 1)
{
throw new InvalidOperationException("The maximum indentation level must be at least 1.");
}

StringBuilder sb = new();
sb.AppendLine("flowchart LR");

Expand Down

0 comments on commit 55937a0

Please sign in to comment.