Skip to content
This repository
Browse code

[BACKPORT] prevent key error in population building.

  • Loading branch information...
commit 16ed1de9d71b10f03243c3d309510a89eba1f3a5 1 parent e5ec7ed
Ismail Sunni ismailsunni authored
4 safe/impact_functions/volcanic/volcano_population_evacuation_polygon_hazard.py
@@ -176,8 +176,8 @@ def run(self, layers):
176 176 key = name * 1000 # Convert to meters
177 177 else:
178 178 key = name
179   -
180   - pop = int(categories[key])
  179 + # prevent key error
  180 + pop = int(categories.get(key, 0))
181 181
182 182 pop = round_thousand(pop)
183 183

0 comments on commit 16ed1de

Please sign in to comment.
Something went wrong with that request. Please try again.