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>() {
|
return new ExperienceManager<CraftItemExperienceSource>() {
|
||||||
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||||
public void a(CraftItemEvent event) {
|
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());
|
PlayerData data = PlayerData.get((Player) event.getWhoClicked());
|
||||||
for (CraftItemExperienceSource source : getSources())
|
for (CraftItemExperienceSource source : getSources())
|
||||||
if (source.matches(data, event.getInventory().getResult().getType()))
|
if (source.matches(data, event.getInventory().getResult().getType()))
|
||||||
|
@ -136,10 +136,15 @@ public class PlayerData extends OfflinePlayerData {
|
|||||||
try {
|
try {
|
||||||
boundSkills.set(j, getProfess().getSkill(boundSkills.get(j).getSkill()));
|
boundSkills.set(j, getProfess().getSkill(boundSkills.get(j).getSkill()));
|
||||||
j++;
|
j++;
|
||||||
} catch (NullPointerException notFound) {
|
} catch (NullPointerException npe1) {
|
||||||
boundSkills.remove(j);
|
boundSkills.remove(j);
|
||||||
|
try {
|
||||||
MMOCore.log(Level.SEVERE, "[Userdata] Could not find skill " + boundSkills.get(j).getSkill().getId() + " in class "
|
MMOCore.log(Level.SEVERE, "[Userdata] Could not find skill " + boundSkills.get(j).getSkill().getId() + " in class "
|
||||||
+ getProfess().getId() + " while refreshing player data.");
|
+ 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