From 18bed0ce80b608b8188abae137175f07c3659bb2 Mon Sep 17 00:00:00 2001 From: David Gay Date: Wed, 23 Jun 2021 20:26:53 -0400 Subject: Fix activities without requirements not completing --- CHANGELOG.md | 2 ++ app/lib/activity_processor.rb | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 16a9213..38b0462 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ All notable changes to this project will be documented in this file. ### Fixed - Results and chat areas sometimes didn't scroll to bottom when they should. This was caused by large result outputs being larger than the scroll tolerance. +- Activities without any requirements (such as opening an unlocked rusted lockbox or building a level 1 hearth + amenity) would fail. ## [0.1.11.3] - 2021-06-22 diff --git a/app/lib/activity_processor.rb b/app/lib/activity_processor.rb index 6509b44..d995e06 100644 --- a/app/lib/activity_processor.rb +++ b/app/lib/activity_processor.rb @@ -121,7 +121,7 @@ class ActivityProcessor # But just something to keep in mind. # Note: This will result in equipment being checked twice if it provides two speed stats. # Fine for now since no equipment gives two skill speed stats, but may want to refine in the future. - if @activity.whatnot[:requirements].any? + if @activity.whatnot[:requirements]&.any? required_skill_gids = @activity.whatnot[:requirements].select { |r| r[:type] == "skill" }.map { |r| r[:gid] }.uniq required_skill_gids.each do |required_skill_gid| skill = Skill.find_by_gid(required_skill_gid) -- cgit v1.2.3