Skip to content

Commit cf76ce1

Browse files
committed
Update Helpers.java
1 parent 4a16949 commit cf76ce1

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

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

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ public static String GetMachineCode() {
4545
* to the default method, GetMachineCode, this method does not depend on slf4j to compute
4646
* the device fingerprint, assuming that v=2. If v=2, the result of this method should be
4747
* the same as in the .NET SDK and Python on Windows.
48+
* <p>
49+
* <strong>Note</strong>: If it is not possible to retrieve the UUID, this method will return null.
50+
* Please keep this in mind and check for the null case.
51+
* </p>
4852
* @param v If set to 2, this method will use the UUID of the device instead of depending
4953
* on slf4j. Note, it currently only supports Windows. You can read more
5054
* here: https://help.cryptolens.io/faq/index#java.
@@ -77,7 +81,13 @@ public static String GetMachineCode(int v) {
7781
}
7882

7983
String res = sb.toString();
80-
return SHA256(res.toString().trim());
84+
String seed = res.toString().trim();
85+
86+
if(seed == "") {
87+
return null;
88+
}
89+
90+
return SHA256(seed);
8191

8292
} catch(Exception e){
8393

0 commit comments

Comments
 (0)