From abff59b7d69802904d693bff689bcba0afb512a6 Mon Sep 17 00:00:00 2001 From: utox39 Date: Sat, 13 Sep 2025 17:40:53 +0200 Subject: [PATCH] fix(config): fix null value access when config file are not used --- src/config.zig | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/config.zig b/src/config.zig index c081bbd..b06d8a4 100644 --- a/src/config.zig +++ b/src/config.zig @@ -31,7 +31,9 @@ pub const ModuleType = enum { }; pub fn getAsciiPath(config: ?std.json.Parsed(Config)) ?[]u8 { - return config.?.value.ascii_abs_path; + if (config) |c| { + return c.value.ascii_abs_path; + } else return null; } pub fn getModulesTypes(allocator: std.mem.Allocator, config: ?std.json.Parsed(Config)) !std.array_list.Managed(ModuleType) {