Commit b5baa41077

Andrew Kelley <andrew@ziglang.org>
2023-03-01 21:31:02
fix zig fmt crash
1 parent a7754d2
Changed files (1)
src/main.zig
@@ -5120,8 +5120,8 @@ fn fmtPathFile(
     var tree = try Ast.parse(gpa, source_code, .zig);
     defer tree.deinit(gpa);
 
-    try printAstErrorsToStderr(gpa, tree, file_path, fmt.color);
     if (tree.errors.len != 0) {
+        try printAstErrorsToStderr(gpa, tree, file_path, fmt.color);
         fmt.any_error = true;
         return;
     }