[Solved] HashMap get method returns NullPointerException
[ad_1] This code should not raise NullPointerException if ( helmet != null ) { Float helmetArmor = helmetValues.get(helmet.getType(); if ( helmetArmor != null ) { armorValue += helmetArmor ; } } Maybe your player has not helmet? 1 [ad_2] solved HashMap get method returns NullPointerException