fix(config): fix null value access when config file are not used

This commit is contained in:
utox39
2025-09-13 17:40:53 +02:00
parent 1dc0559b8e
commit abff59b7d6

View File

@@ -31,7 +31,9 @@ pub const ModuleType = enum {
}; };
pub fn getAsciiPath(config: ?std.json.Parsed(Config)) ?[]u8 { 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) { pub fn getModulesTypes(allocator: std.mem.Allocator, config: ?std.json.Parsed(Config)) !std.array_list.Managed(ModuleType) {