summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Gay <david@davidgay.org>2021-06-23 20:26:53 -0400
committerDavid Gay <david@davidgay.org>2021-06-23 20:26:53 -0400
commit18bed0ce80b608b8188abae137175f07c3659bb2 (patch)
tree705c5e2cd6ec3d3b003923d3f84f46ad6ee96f27
parentc608468b7d6dad0a007ce1031724737b02fbdd55 (diff)
Fix activities without requirements not completing
-rw-r--r--CHANGELOG.md2
-rw-r--r--app/lib/activity_processor.rb2
2 files changed, 3 insertions, 1 deletions
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)