NaomiProject / Naomi

The Naomi Project is an open source, technology agnostic platform for developing always-on, voice-controlled applications!
https://projectnaomi.com/
MIT License
242 stars 47 forks source link

Fix issue with empty profile.yml file #414

Closed aaronchantrill closed 2 weeks ago

aaronchantrill commented 2 weeks ago

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: