Project

General

Profile

« Previous | Next » 

Revision 083d3024

Added by Marc Dequènes over 13 years ago

  • ID 083d30249943ac94ea43bf26cd887c47473b55d0

[fix] don't crash if config or default config is empty

View differences:

lib/cyborghood/base/config.rb
unless name.nil?
config_spc_raw = load_config_raw(name)
spc_def = parse('config', name, config_spc_raw)
spc_def = parse('config', name, config_spc_raw) || {}
default_config_spc = load_default_config(name)
spc_config = merge_into_default_config(default_config_spc, spc_def)
......
filename = File.join(DATA_DIR, "default_config", type.downcase + ".yaml")
default_config_raw = File.read(filename)
default_config = parse(':defaults:', type, default_config_raw, false)
default_config
default_config || {}
rescue
logger.fatal "Could not load default config for '%s': %s" % [type, $!]
exit 1

Also available in: Unified diff