Romern / syncMyMoodle

Synchronization client for RWTH Moodle
GNU General Public License v3.0
72 stars 18 forks source link

configs without used_modules lead to severa Nonetype-Exceptions #38

Closed ACHinrichs closed 3 years ago

ACHinrichs commented 3 years ago

Clauses like config.get("used_modules",{}).get("assign",{})yield a AttributeError: 'NoneType' object has no attribute 'get' if the used_modules ist not included in the config file.

Maybe either add a check if config.get("used_modules",{})is not None for each time it is used, or check it once right after loading the config and update the file if it is not yet included?

Romern commented 3 years ago

Fixed with https://github.com/Romern/syncMyMoodle/commit/bea4faca0a646e9fb0dd94bb211e372e5995bade