hook_flag_access_id_on_null_2.patch 690 B

12345678910111213
  1. diff --git a/flag_lists.module b/flag_lists.module
  2. index cd81104..1da0c9a 100644
  3. --- a/flag_lists.module
  4. +++ b/flag_lists.module
  5. @@ -240,7 +240,7 @@ function flag_lists_flag_action_access($action, FlagInterface $flag, AccountInte
  6. $flagListsService = Drupal::service('flaglists');
  7. $flagLists = $flagListsService->getAllFlaggingCollections();
  8. foreach ($flagLists as $flagList) {
  9. - if ($flag->id() == $flagList->getRelatedFlag()->id()) {
  10. + if ($flagList->getRelatedFlag() && $flag->id() == $flagList->getRelatedFlag()->id()) {
  11. if ($flagList->getBaseFlag()->isGlobal()) {
  12. // The flag list is global.
  13. return AccessResult::allowedIfHasPermission($account,