mirror of
https://github.com/bitcoinj/bitcoinj.git
synced 2025-02-23 14:40:40 +01:00
Message: add a defensive null check to getParams()
This commit is contained in:
parent
3bc82cd9f7
commit
455973557a
1 changed files with 2 additions and 1 deletions
|
@ -27,6 +27,7 @@ import java.io.IOException;
|
|||
import java.io.OutputStream;
|
||||
import java.nio.BufferUnderflowException;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* <p>A Message is a data structure that can be serialized/deserialized using the Bitcoin serialization format.
|
||||
|
@ -151,6 +152,6 @@ public abstract class Message {
|
|||
|
||||
/** Network parameters this message was created with. */
|
||||
public NetworkParameters getParams() {
|
||||
return params;
|
||||
return Objects.requireNonNull(params);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue