kayuminbou / node-red-contrib-ipwhois

0 stars 1 forks source link

Crash of node-red after timeout #1

Open NoSuchException87 opened 3 years ago

NoSuchException87 commented 3 years ago

Hi, I found a very bad problem about this node. When a whois call goes in timeout the script goes in error at 33th row because data is undefined and it tries to call split method on an undefined object. The badly thing is that this error causes the crash of the node-red server and it need to be restarted, so it's an important problem in production envirenment. I solved this problem modifyng on my system the 33th row from :

data_list = data.split('\n');

to:

data_list = data ? data.split('\n') : [];

In this way at the end of execution I have an object with netname, desc and country void and most important node-red server doesn't crash. I don't know if you have a better solution to suggest me, otherwise I hope this fix can be useful for you if you would to implement it.

Bye

sgurgul commented 2 years ago

Confirmed. 2022.04 timeout still causes NR to completely crash! Is there any chance this will be fixed ?