diff options
author | David Gay <david@davidgay.org> | 2021-06-09 21:27:36 -0400 |
---|---|---|
committer | David Gay <david@davidgay.org> | 2021-06-09 21:27:36 -0400 |
commit | 6fbb3db6f1dda597cc997fa07ab6545ef99f717d (patch) | |
tree | 72a266f1157889a461340d788cdbdab3d325d476 /app/lib | |
parent | a068f2a59cd7070ec7a59b32908bde5ede4a1fb7 (diff) |
Extra guards to prevent running activity duration check code when important related values are nil (hopefully fixes #3 and fixes #2)
Diffstat (limited to 'app/lib')
-rw-r--r-- | app/lib/activity_processor.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/lib/activity_processor.rb b/app/lib/activity_processor.rb index 72c7ddd..b5dd11c 100644 --- a/app/lib/activity_processor.rb +++ b/app/lib/activity_processor.rb @@ -9,7 +9,7 @@ class ActivityProcessor end def process - return unless @character.activity_time_remaining <= 0 + return unless @character.activity && @character.activity_time_remaining <= 0 if @character.resting? @results.replace([{ type: "error", message: "You can't do anything while you're resting." }]) @character.stop_activity |