Skip to content

Commit 8e16e9b

Browse files
Fix bug in Generator.Dedent();
Calling Dedent() when the target class has no namespace would try to set tabLength to a negative value.
1 parent 3172344 commit 8e16e9b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Assets/Editor/CustomInspectorCreator/Utilities/Generator.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,10 @@ private void Indent()
363363

364364
private void Dedent()
365365
{
366-
tabLevel = tabLevel.Remove(tabLevel.Length - 1);
366+
if(tabLevel.Length > 0)
367+
{
368+
tabLevel = tabLevel.Remove(tabLevel.Length - 1);
369+
}
367370
}
368371

369372
private string GetVarName(string className)

0 commit comments

Comments
 (0)