When using yaml.safe_load() on an empty text file, the returned value is None rather than an empty dictionary as I expected. This caused an error when adding the first value, as I would get the error message "NoneType object does not support item assignment".
This patch changes a None value into an empty dictionary.
Description
When using yaml.safe_load() on an empty text file, the returned value is None rather than an empty dictionary as I expected. This caused an error when adding the first value, as I would get the error message "NoneType object does not support item assignment".
This patch changes a None value into an empty dictionary.
Related Issue
NoneType does not support item assignment #413
How Has This Been Tested?
flake8 and unit tests. I also tried running Naomi with an empty profile.yml file and it worked after applying this patch.
Screenshots (if appropriate):
Types of changes
Checklist: