xwp / stream

🗄️ Stream plugin for WordPress
https://wordpress.org/plugins/stream/
GNU General Public License v2.0
405 stars 119 forks source link

PHP Error accessing user in wp cli triggered update #1442

Open NicktheGeek opened 11 months ago

NicktheGeek commented 11 months ago

Bug Report

Expected Behavior

The user object would be checked before attempting to use any fields or values.

Actual Behavior

Get user is used to get a user, but false is returned because the user doesn't exist. This results in the error:

Warning: Attempt to read property "user login" on bool in /code/wp-content/plugins/stream/alerts/class-alert-type-ifttt.php on line 232

This may occur in other alerts, but this is the one currently triggering the problem.

Steps to Reproduce the Problem

  1. trigger an alert where the user ID does not return a valid user
  2. see the warning

Screenshots

Drag and drop screenshots in this area that help illustrate the problem.

System Information

This was noted when running a WPCLI command so the browser and OS are not applicable.