diff --git a/source/antlr/v4/runtime/CommonToken.d b/source/antlr/v4/runtime/CommonToken.d index e837ee6..3146455 100644 --- a/source/antlr/v4/runtime/CommonToken.d +++ b/source/antlr/v4/runtime/CommonToken.d @@ -323,7 +323,7 @@ class CommonToken : WritableToken channelStr=",channel=" ~ to!string(channel); } auto txt = getText.get!(string); - if (txt) { + if (txt.length > 0) { txt = txt.replace("\n","\\n"); txt = txt.replace("\r","\\r"); txt = txt.replace("\t","\\t");