Fixes HeroBuilder NullPointerException #35.

This commit is contained in:
Ilkka Seppala 2015-03-23 21:46:51 +02:00
parent dd855a376b
commit 62b871774a

View File

@ -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;