From acb52d824a10cdcbd29198a6efbc2c519c32e4c8 Mon Sep 17 00:00:00 2001 From: Matheus <30329820+matttheus@users.noreply.github.com> Date: Fri, 28 Nov 2025 11:42:53 -0300 Subject: [PATCH] add idsearch terminated records none verification Sometimes the status code from result is terminated and the records is none, it throws the following error: intelx_identity.py, line 58, in idsearch for a in r['records']: TypeError: 'NoneType' object is not iterable --- Python/intelx/intelx_identity.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Python/intelx/intelx_identity.py b/Python/intelx/intelx_identity.py index a0f33a2..3d98f62 100644 --- a/Python/intelx/intelx_identity.py +++ b/Python/intelx/intelx_identity.py @@ -44,8 +44,9 @@ def idsearch(self, term, maxresults=100, buckets="", timeout=5, datefrom="", dat results.append(a) maxresults -= len(r['records']) if (r['status'] == 2 or maxresults <= 0): - for a in r['records']: - results.append(a) + if r['records']: + for a in r['records']: + results.append(a) if (maxresults <= 0): self.terminate_search(search_id) done = True