Skip to content

Commit

Permalink
Merge pull request #3 from Shrikantbache/patch-2
Browse files Browse the repository at this point in the history
Update __init__.py
  • Loading branch information
sumithemmadi authored Apr 21, 2022
2 parents f663f40 + 402ba87 commit 4493288
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions truecallerpy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ def truecallerpy_search_phonenumber(config):

elif jsonInfo["data"] != None and config["json"] == False and config["raw"] == True and config["name"] == False and config["email"] == True:
try:
if "id" in jsonInfo["data"][0]["internetAddresses"][0]:
if len(jsonInfo["data"][0]["internetAddresses"])>0 and "id" in jsonInfo["data"][0]["internetAddresses"][0]:
email = jsonInfo["data"][0]["internetAddresses"][0]["id"]
else:
email = "Email not found"
Expand All @@ -176,7 +176,7 @@ def truecallerpy_search_phonenumber(config):

elif jsonInfo["data"] != None and config["json"] == False and config["raw"] == False and config["name"] == False and config["email"] == True:
try:
if "id" in jsonInfo["data"][0]["internetAddresses"][0]:
if len(jsonInfo["data"][0]["internetAddresses"])>0 and "id" in jsonInfo["data"][0]["internetAddresses"][0]:
email = jsonInfo["data"][0]["internetAddresses"][0]["id"]
else:
email = "Email not found"
Expand All @@ -189,7 +189,8 @@ def truecallerpy_search_phonenumber(config):
else:
print(json.dumps(jsonInfo, indent=3))






def truecallerpy_get_installationId(config):
Expand Down

0 comments on commit 4493288

Please sign in to comment.