mirror of
https://gitlab.com/phoenix-dvpmt/mmocore.git
synced 2024-11-24 00:15:16 +01:00
Fixed two random NPE
This commit is contained in:
parent
0aa36dacd5
commit
753f63104a
@ -28,7 +28,8 @@ public class CraftItemExperienceSource extends SpecificExperienceSource<Material
|
||||
return new ExperienceManager<CraftItemExperienceSource>() {
|
||||
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||
public void a(CraftItemEvent event) {
|
||||
if(event.getAction() == InventoryAction.NOTHING) return;
|
||||
if(event.getAction() == InventoryAction.NOTHING ||
|
||||
event.getInventory().getResult() == null) return;
|
||||
PlayerData data = PlayerData.get((Player) event.getWhoClicked());
|
||||
for (CraftItemExperienceSource source : getSources())
|
||||
if (source.matches(data, event.getInventory().getResult().getType()))
|
||||
|
@ -136,10 +136,15 @@ public class PlayerData extends OfflinePlayerData {
|
||||
try {
|
||||
boundSkills.set(j, getProfess().getSkill(boundSkills.get(j).getSkill()));
|
||||
j++;
|
||||
} catch (NullPointerException notFound) {
|
||||
} catch (NullPointerException npe1) {
|
||||
boundSkills.remove(j);
|
||||
MMOCore.log(Level.SEVERE, "[Userdata] Could not find skill " + boundSkills.get(j).getSkill().getId() + " in class "
|
||||
+ getProfess().getId() + " while refreshing player data.");
|
||||
try {
|
||||
MMOCore.log(Level.SEVERE, "[Userdata] Could not find skill " + boundSkills.get(j).getSkill().getId() + " in class "
|
||||
+ getProfess().getId() + " while refreshing player data.");
|
||||
} catch (NullPointerException npe2) {
|
||||
MMOCore.log(Level.SEVERE, "[Userdata] Could not find unidentified skill in class "
|
||||
+ getProfess().getId() + " while refreshing player data.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user