utmstack / UTMStack

Customizable SIEM and XDR powered by Real-Time correlation and Threat Intelligence
https://utmstack.com
GNU Affero General Public License v3.0
196 stars 18 forks source link

Correct conditional check for IP info search results #694

Closed leonardomoralopez89 closed 1 month ago

leonardomoralopez89 commented 1 month ago

Updated the getIpInfo method to fix the conditional check when evaluating the total hits from the Elasticsearch search result. Changed the condition from hits.total().value() < 0 to hits.total().value() <= 0 to correctly handle cases where no search results are found, preventing potential IndexOutOfBoundsException.