Skip to content

Commit

Permalink
Added guard clause for when quest doesn't exist
Browse files Browse the repository at this point in the history
  • Loading branch information
markbmullins committed Dec 6, 2020
1 parent 2130181 commit 179570b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/plugins/quests/quest-journal-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ import { pluginActions } from '@server/game-server';
export const action: buttonAction = (details) => {
const { player, buttonId } = details;
const [questData] = pluginActions.quest.filter((quest) => quest.quest.questTabId === buttonId);
if(!questData) {
return;
}
const quest = questData.quest;

const [playerQuest] = player.quests.filter(
Expand Down

0 comments on commit 179570b

Please sign in to comment.