Skip to content

Commit 1639eaf

Browse files
author
Hideki Itakura
committed
Merge pull request #1168 from couchbase/feature/issue_listener_68
Fixed couchbase-lite-java-listener 68 - 1.2.1 Listener reporting inva…
2 parents 79fc493 + 47add50 commit 1639eaf

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

src/main/java/com/couchbase/lite/support/Version.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public class Version {
1212

1313
static {
1414
int versCode = getVersionCode();
15-
if (versCode == -1) {
15+
if (versCode != 0) {
1616
VERSION = String.format("%s-%s", getVersionName(), getVersionCode());
1717
} else{
1818
VERSION = String.format("%s", getVersionName());
@@ -37,12 +37,11 @@ public static int getVersionCode() {
3737
}
3838

3939
try {
40-
Integer.parseInt(VERSION_CODE);
40+
return Integer.parseInt(VERSION_CODE);
4141
} catch (NumberFormatException e) {
4242
Log.w(Log.TAG, "Cannot parse version code: %s", VERSION_CODE);
4343
return 0;
4444
}
45-
return -1;
4645
}
4746

4847
public static String getVersion() {

0 commit comments

Comments
 (0)