diff --git a/Scripts/script-ExtractDomainFromUrlFormat.yml b/Scripts/script-ExtractDomainFromUrlFormat.yml index 20930757806c..1415601f6b25 100644 --- a/Scripts/script-ExtractDomainFromUrlFormat.yml +++ b/Scripts/script-ExtractDomainFromUrlFormat.yml @@ -16,8 +16,16 @@ script: |- if len(domain.group()) > 0: demisto.results(domain.group()[1:]) else: - domain = get_tld(inp) - demisto.results(domain) + domain = get_tld(inp, fail_silently=True) + if not domain: + inp_with_http = 'https://'+inp + domain = get_tld(inp_with_http, fail_silently=True) + if domain: + demisto.results(domain) + else: + demisto.results("") + else: + demisto.results(domain) type: python tags: - indicator-format @@ -30,3 +38,4 @@ args: description: The URL or Email to process scripttarget: 0 dockerimage: demisto/tld +releaseNotes: 'avoid error in domain format script' \ No newline at end of file