only close if opened
Some checks failed
AWS-Zig Build / build-zig-0.11.0-amd64-host (push) Failing after 1m33s

This commit is contained in:
Emil Lerch 2023-08-15 07:26:14 -07:00
parent 4a6f49ac3b
commit c3da8c067f
Signed by: lobo
GPG Key ID: A7B62D657EF764F8

View File

@ -15,7 +15,7 @@ pub fn main() anyerror!void {
const stdout = std.io.getStdOut().writer(); const stdout = std.io.getStdOut().writer();
var output_dir = std.fs.cwd(); var output_dir = std.fs.cwd();
defer output_dir.close(); defer if (output_dir.fd > 0) output_dir.close();
var models_dir: ?std.fs.IterableDir = null; var models_dir: ?std.fs.IterableDir = null;
defer if (models_dir) |*m| m.close(); defer if (models_dir) |*m| m.close();
for (args, 0..) |arg, i| { for (args, 0..) |arg, i| {