ucsb-cs56-w20 / mapache-search

https://mapache-search-qa.herokuapp.com/
2 stars 3 forks source link

Resolved Index Out Of Bounds #261

Closed Adarsha58 closed 4 years ago

Adarsha58 commented 4 years ago

Upon clicking the search button in the mapache search page, it lead to an error page complaining "something went wrong, we're fixing it." Upon tracking where the error was coming from with Scott Chow, we found out that it was due to index out of bound exception in the line 26 of previewProviderServiceImp.java. You can clearly see the problem with short circuiting in line 26.

On that if-statement of that line, we first check if the parts.length > 1 and then we try to access parts[2] which is a blunder error, because if the length of "parts" is exactly 2 then we cannot access the third element.