fix crash when loading an empty config file #611
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
YAML returns
false
when the file contains no real data, even if it does contain comments. This breaks Rubocop, which is expecting aHash
.This is a real-world issue because
rubocop-todo.yml
instructs the user to remove items one by one until everything's green, but doing so causes a crash when the final item is removed.This pull request simply ensures that a
Hash
is used if YAML returnsfalse
.