Skip to content

Commit b7f3215

Browse files
committed
Check result before grabbing index val
1 parent a5cf8d3 commit b7f3215

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

awscli/telemetry.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ def _create_host_id_table(self):
111111

112112
def _ensure_host_id(self):
113113
cur = self.execute(self._CHECK_HOST_ID)
114-
host_id_ct = cur.fetchone()[0]
115-
if host_id_ct == 0:
114+
host_id_ct = cur.fetchone()
115+
if host_id_ct and host_id_ct[0] == 0:
116116
self.execute(
117117
self._INSERT_HOST_ID,
118118
# Hardcode `0` as primary key to ensure

0 commit comments

Comments
 (0)