Prevent fatal error on "Notification center" if flagging entity was accidentally deleted

Created on 30 May 2024, 10 months ago
Updated 2 July 2024, 9 months ago

Problem/Motivation

Fatal error on "Notification centre" (/notifications page):

The website encountered an unexpected error. Try again later.

Error: Call to a member function getFlaggableType() on null in Drupal\activity_creator\Entity\Activity->getRelatedEntityUrl() (line 279 of profiles/contrib/social/modules/custom/activity_creator/src/Entity/Activity.php).

Solutuon

Add checks to prevent methods from calling on empty object.

πŸ› Bug report
Status

Fixed

Version

13.0

Component

Code (back-end)

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024