Add customized NPE for null actor system (#23580)
* Add customized NPE for null actor system * "system must not be null!"
This commit is contained in:
parent
1e4e7cbba2
commit
b600c517a1
1 changed files with 3 additions and 1 deletions
|
|
@ -74,7 +74,9 @@ trait ExtensionId[T <: Extension] {
|
|||
/**
|
||||
* Returns an instance of the extension identified by this ExtensionId instance.
|
||||
*/
|
||||
def apply(system: ActorSystem): T = system.registerExtension(this)
|
||||
def apply(system: ActorSystem): T = {
|
||||
java.util.Objects.requireNonNull(system, "system must not be null!").registerExtension(this)
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an instance of the extension identified by this ExtensionId instance.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue