Check for null quest

This commit is contained in:
PikaMug 2019-07-13 00:20:14 -04:00
parent 321a74cd8e
commit a9bed845ad

View File

@ -3127,6 +3127,9 @@ public class Quester {
* @return true if available * @return true if available
*/ */
public boolean canAcceptOffer(Quest quest, boolean giveReason) { public boolean canAcceptOffer(Quest quest, boolean giveReason) {
if (quest == null) {
return false;
}
if (getCurrentQuests().size() >= plugin.getSettings().getMaxQuests() && plugin.getSettings().getMaxQuests() > 0) { if (getCurrentQuests().size() >= plugin.getSettings().getMaxQuests() && plugin.getSettings().getMaxQuests() > 0) {
if (giveReason) { if (giveReason) {
String msg = Lang.get(getPlayer(), "questMaxAllowed"); String msg = Lang.get(getPlayer(), "questMaxAllowed");