Skip to content

Commit

Permalink
avoid IndexOutOfBounds with query =
Browse files Browse the repository at this point in the history
fixes #365
  • Loading branch information
TrianguloY committed Jul 15, 2024
1 parent 10c24a6 commit d51653a
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import com.trianguloy.urlchecker.utilities.methods.AndroidUtils;
import com.trianguloy.urlchecker.utilities.methods.Inflater;

import java.net.URLDecoder;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
Expand Down Expand Up @@ -190,16 +189,16 @@ public int queriesSize() {
* Returns the name of a query (by index)
*/
public String getQueryName(int index) {
return queries.get(index).split("=")[0];
return splitFix(queries.get(index),"=").get(0);
}

/**
* Returns the decoded value of a query (by index)
*/
public String getQueryValue(int index) {
String[] split = queries.get(index).split("=");
if (split.length == 1) return "";
return decode(split[1]);
var split = splitFix(queries.get(index),"=");
if (split.size() <= 1) return "";
return decode(split.get(1));
}

/**
Expand Down

0 comments on commit d51653a

Please sign in to comment.