digital_ocean.py
19.4 KB
-
digital_ocean #3438: use get instead of [] to prevent KeyError · 0c9c4ae4
The existing code was using: a[b][c[d]] where a[b] would always exist and c[d] would always exist. But the nested index would not alway exist, particularly when a DigitalOcean item disapeared. This changes that nested index to a `get` and properly handles None results. This bug was present in two spots in this file.
Evan Wies committed