How to prevent site that take my ip instead if there no ip captured from parse?

Hello there, i using this site http://ip-api.com/json/<IP> that give country/region for <IP> that come from capture

The problem here is if the <IP> not found, parsed capture comes empty, and the site automatically give me country/region of my ip instead.

is there a way to prevent the site from doing auto task like this without forcing Failure Key since that will lead to not progress as Success as there another tasks to do after?

  • Example

Parse IP Result Ex: Empty

http://ip-api.com/json/<IP>

Gives My IP Country/Region

  • What i want

Gives Nothing and pass to the next progress or give another Parse that i want instead if the <IP> result is empty

  • And if Parse IP Result Ex: 127.0.0.1

it progress to capture what comes

There are a few ways you can go about this but the easiest would to check if the var is NULL and if it is then to add your own in C# or Lolicode directly

// BLOCK: Check NULL String
if ( var/string == NULL ) {
	var var/string="Fail"
}
1 Like

i figure it out thank you for trying to help <3

i had to make FUNCTION Constant for the first Parsed capture IP so there has to be string come and not empty

as it bring <IP> if ip is empty which lead the link not auto detect my ip and bring invalid query instead

The thing is if the api site http://ip-api.com/json/ didn’t get any string after json/
it’s automatically give the user details, but if there any string putted after json/ that is not ip then it will return invalid query.

So when i made FUNCTION Constant as second capture for the first parse it force a string come out if no capture it return <IP> and not empty value.

Which fixes my problem to not let the site do request as http://ip-api.com/json/ only without string putted after json/