Skip to content

Commit

Permalink
[FABJ-377] Possible NPE in SDKUtils
Browse files Browse the repository at this point in the history
There is a null reference check for "client" in SDKUtils.calculateBlockHash()
It should be on "cryptoSuite" instead of "client"

- check "cryptoSuite" instead of "client" for null reference

Change-Id: I67bad22ba19d08130b43fb0a346e1577204962aa
Signed-off-by: Ivo Huisjes <fabric-sdk@spam4.me>
  • Loading branch information
Ivo Huisjes committed Oct 21, 2018
1 parent 0c6ff37 commit ce7fd3b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/org/hyperledger/fabric/sdk/SDKUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public static byte[] calculateBlockHash(HFClient client, long blockNumber, byte[
}

CryptoSuite cryptoSuite = client.getCryptoSuite();
if (null == client) {
if (null == cryptoSuite) {
throw new InvalidArgumentException("Client crypto suite has not been set.");
}

Expand Down

0 comments on commit ce7fd3b

Please # to comment.