mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-10-14 04:16:14 +00:00
Fixes HeroBuilder NullPointerException #35.
This commit is contained in:
1 parent
dd855a376b
commit
62b871774a
1 file changed
+1
-1
@@ -94,7 +94,7 @@ public class Hero {
|
|||||||
|
|
||||||
public HeroBuilder(Profession profession, String name) {
|
public HeroBuilder(Profession profession, String name) {
|
||||||
if (profession == null || name == null) {
|
if (profession == null || name == null) {
|
||||||
throw new NullPointerException(
|
throw new IllegalArgumentException(
|
||||||
"profession and name can not be null");
|
"profession and name can not be null");
|
||||||
}
|
}
|
||||||
this.profession = profession;
|
this.profession = profession;
|
||||||
|
|||||||
Reference in new issue
Block a user