Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logging a WP_Error with no data triggers a fatal error #36

Closed
johnbillion opened this issue May 14, 2018 · 2 comments
Closed

Logging a WP_Error with no data triggers a fatal error #36

johnbillion opened this issue May 14, 2018 · 2 comments
Assignees
Labels

Comments

@johnbillion
Copy link

Version Information

  • PHP: 7.2
  • WordPress: 4.9

Steps to Reproduce

Attempt to log a WP_Error object that doesn't contain a $data property, for example by using the following PHP code:

do_action( 'wonolog.log.error', new \WP_Error( 'hello', 'world' ) );

What I Expected

The WP_Error object gets logged.

What Happened Instead

A fatal error is triggered by Wonolog:

Uncaught TypeError: Argument 4 passed to Inpsyde\Wonolog\Data\Log::__construct() must be of the type array, null given, called in src/Data/Log.php on line 74
@gmazzap gmazzap self-assigned this May 14, 2018
@gmazzap gmazzap added the bug label May 14, 2018
gmazzap added a commit that referenced this issue May 14, 2018
@gmazzap
Copy link
Contributor

gmazzap commented May 14, 2018

Thanks for reporting. The fix is merged on master, will be released on next release.

@gmazzap
Copy link
Contributor

gmazzap commented May 15, 2018

Fix merged in v1.0.2

@gmazzap gmazzap closed this as completed May 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants