mirror of
https://github.com/Zrips/Jobs.git
synced 2024-11-29 22:13:25 +01:00
Fix NPE when getting quest
This commit is contained in:
parent
ab3ea2e77d
commit
f8d9862a8b
@ -446,10 +446,15 @@ public class Job {
|
||||
}
|
||||
|
||||
public Quest getQuest(String name) {
|
||||
if (name == null || name.trim().isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
for (Quest one : quests) {
|
||||
if (one.getConfigName().equalsIgnoreCase(name))
|
||||
return one;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -12,8 +12,8 @@ import com.gamingmesh.jobs.Jobs;
|
||||
|
||||
public class Quest {
|
||||
|
||||
private String configName;
|
||||
private String questName;
|
||||
private String configName = "";
|
||||
private String questName = "";
|
||||
private Job job;
|
||||
private Long validUntil = 0L;
|
||||
|
||||
|
@ -11,17 +11,21 @@ import com.gamingmesh.jobs.Jobs;
|
||||
public class QuestProgression {
|
||||
|
||||
private Quest quest;
|
||||
|
||||
private long validUntil;
|
||||
private boolean givenReward = false;
|
||||
|
||||
private HashMap<QuestObjective, Integer> done = new HashMap<>();
|
||||
|
||||
public QuestProgression(Quest quest) {
|
||||
this.quest = quest;
|
||||
|
||||
validUntil = quest.getValidUntil();
|
||||
}
|
||||
|
||||
public Quest getQuest() {
|
||||
return quest == null ? null : quest.getJob().getQuest(quest.getConfigName());
|
||||
Quest q = quest == null ? null : (quest.getJob() == null ? null : quest.getJob().getQuest(quest.getConfigName()));
|
||||
return q;
|
||||
}
|
||||
|
||||
public void setQuest(Quest quest) {
|
||||
|
Loading…
Reference in New Issue
Block a user