Skip to content

Commit 3c61d1f

Browse files
committed
Fix Helpers.IsOnRightMachine
1 parent 27b6b4d commit 3c61d1f

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<groupId>io.cryptolens</groupId>
55
<artifactId>cryptolens</artifactId>
66
<packaging>jar</packaging>
7-
<version>1.8-STABLE</version>
7+
<version>1.9-STABLE</version>
88
<name>cryptolens</name>
99
<description>A client api to access Cryptolens Licensing API.</description>
1010
<url>https://github.com/cryptolens/cryptolens-java</url>

src/main/java/io/cryptolens/methods/Helpers.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,11 @@ public static boolean IsOnRightMachine(LicenseKey license, String machineCode, b
119119
}
120120

121121
if(isFloatingLicense) {
122-
if(license.ActivatedMachines.size() == 1 &&
123-
(license.ActivatedMachines.get(0).Mid.substring(9).equals(current_mid) ||
124-
allowOverdraft && license.ActivatedMachines.get(0).Mid.substring(19).equals(current_mid))) {
125-
return true;
122+
for (ActivatedMachine machine : license.ActivatedMachines) {
123+
if((machine.Mid.length() >= 9 && machine.Mid.substring(9).equals(current_mid) ||
124+
allowOverdraft && machine.Mid.length() >= 19 && machine.Mid.substring(19).equals(current_mid))) {
125+
return true;
126+
}
126127
}
127128
} else {
128129

0 commit comments

Comments
 (0)