Skip to content

Commit

Permalink
Merge pull request #49 from pylerSM/patch-3
Browse files Browse the repository at this point in the history
Check for array length to prevent OutOfBounds error
  • Loading branch information
javiersantos authored Aug 27, 2016
2 parents 57687ea + c6829c5 commit 87732c0
Showing 1 changed file with 11 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -188,16 +188,20 @@ private static String getVersion(UpdateFrom updateFrom, Boolean isAvailable, Str
switch (updateFrom) {
default:
String[] splitPlayStore = source.split(Config.PLAY_STORE_TAG_RELEASE);
splitPlayStore = splitPlayStore[1].split("(<)");
version = splitPlayStore[0].trim();
if (splitPlayStore.length > 1) {
splitPlayStore = splitPlayStore[1].split("(<)");
version = splitPlayStore[0].trim();
}
break;
case GITHUB:
String[] splitGitHub = source.split(Config.GITHUB_TAG_RELEASE);
splitGitHub = splitGitHub[1].split("(\")");
version = splitGitHub[0].trim();
if (version.contains("v")) { // Some repo uses vX.X.X
splitGitHub = version.split("(v)");
version = splitGitHub[1].trim();
if (splitGitHub.length > 1) {
splitGitHub = splitGitHub[1].split("(\")");
version = splitGitHub[0].trim();
if (version.contains("v")) { // Some repo uses vX.X.X
splitGitHub = version.split("(v)");
version = splitGitHub[1].trim();
}
}
break;
case AMAZON:
Expand Down

0 comments on commit 87732c0

Please sign in to comment.