Skip to content

Commit c789c04

Browse files
committed
fix when eq payload is empty list
1 parent 3f8a823 commit c789c04

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

pyincore/hazardservice.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -209,10 +209,12 @@ def post_earthquake_hazard_values(
209209
"""
210210
url = urljoin(self.base_earthquake_url, hazard_id + "/values")
211211
site_class_dataset_id = ""
212-
value = payload[len(payload) - 1]
213-
if "siteClassId" in value:
214-
payload = payload[:-1]
215-
site_class_dataset_id = value["siteClassId"]
212+
213+
if len(payload) > 0:
214+
value = payload[len(payload) - 1]
215+
if "siteClassId" in value:
216+
payload = payload[:-1]
217+
site_class_dataset_id = value["siteClassId"]
216218

217219
kwargs = {
218220
"files": {

0 commit comments

Comments
 (0)