Skip to content

Commit 1482784

Browse files
committed
Added error throwing when stack is empty and PopIndent() is called
1 parent 88c5b5c commit 1482784

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/Markdig/Renderers/TextRendererBase.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,8 @@ public void PopIndent()
176176
{
177177
if (this.indents.Count > 0)
178178
indents.RemoveAt(indents.Count - 1);
179+
else
180+
throw new InvalidOperationException("No indent to pop");
179181
}
180182

181183
public void ClearIndent() => indents.Clear();

0 commit comments

Comments
 (0)