acook / config_module

Load important configuration files into their own modules
MIT License
2 stars 2 forks source link

Encountered a bug with ConfigModule calling has_key? on false #42

Closed acook closed 5 years ago

acook commented 5 years ago

Here is the error that popped up:

/home/x/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/config_module-1.2.3/lib/config_module.rb:21:in `has_key?': undefined method `has_key?' for false:FalseClass (NoMethodError)
    from /home/x/Source/noizee/lib/noizee/gestalt.rb:40:in `block in setup_sources'
    from /home/x/Source/noizee/lib/noizee/gestalt.rb:39:in `each_pair'
    from /home/x/Source/noizee/lib/noizee/gestalt.rb:39:in `setup_sources'
    from /home/x/Source/noizee/lib/noizee/gestalt.rb:30:in `sources'
    from /home/x/Source/noizee/lib/noizee/gestalt.rb:10:in `listen'
    from /home/x/Source/noizee/lib/noizee.rb:15:in `make_some_noise'
    from ./bin/noizee:5:in `<main>'

The failing code is in the Noizee project, which is innocently calling has_key? on its configuration file.

Worth noting that this is with an empty (0-length) config file.

EDIT

I confirmed that this is due to the config file being empty. Still worth looking into.