SparkDevNetwork/Rock

Prayer Card View Throwing Error When Someone Logged Out Hits "I Prayed" With Prayed Workflow Configured

Closed this issue · 0 comments

Description

When using the Prayer Card View block, if a Prayed Workflow is configured, and someone who is not logged in tries to pray for the request, an "Object reference not set to an instance of an object" exception is thrown. The Prayed Workflow does not get launched.
Video of issue

Actual Behavior

When someone not logged in clicks the "I Prayed" button on a prayer request displayed on the Prayer Card View block, and a Prayed Workflow is configured, an exception is thrown and the Prayed Workflow is not launched.

Expected Behavior

I would expect that whether a person is logged in or not, no exception gets thrown, the prayer count is increased, and the Prayed Workflow is launched. This is happening because in the PrayerRequestService.cs, an exception is thrown when there is no CurrentPerson, but there will not be a CurrentPerson when someone is not logged in.
image

Steps to Reproduce

  • Add the Prayer Request View block to the external website.
  • Add a Prayed Workflow in the Prayer Request View block settings.
  • Add a public prayer request so it appears on the block.
  • Log out.
  • Click "I Prayed" on the prayer request.
  • Examine the exception log and see that one was thrown!

Issue Confirmation

  • Perform a search on the Github Issues to see if your bug or enhancement is already reported.
  • Reproduced the problem on a fresh install or on the demo site.

Rock Version

16.2

Client Culture Setting

en-US