gocodebox / gocodebox/lifterlms

Add a null check to prevent "Attempt to read property ... on null" PHP warnings.

Open
#2,577 1 comment 0 reactions 1 assignee View on GitHub

@ideadude is already working on this.

Since Nov 23, 2023.

Status: Need Information
Dominant language
PHP
Stars
212
Forks
140
Avg merge
2d 14h
Merged PRs (30d)
19

Description

Is your feature request related to a problem? Please describe.
Some users are reporting the following warnings from their logs:

PHP Warning: Attempt to read property "ID" on null in /wp-content/plugins/lifterlms/templates/course/tags.php on line 15
PHP Warning: Attempt to read property "post_type" on null in /wp-content/plugins/lifterlms/includes/abstracts/abstract.llms.post.model.php on line 473

Describe the solution you'd like
Add a null check to prevent this non-fatal warnings.

Describe alternatives you've considered
Just disabling PHP warnings on the server.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.