Skip to content

Error when event is triggered that does not conform to expected structure #386

Closed as not planned
@MichelJonkman

Description

@MichelJonkman

Description

Hybridly throws the "hybridly.response" event that has an array as it's first parameter. This causes the following error to occur.

Error: method_exists(): Argument #1 ($object_or_class) must be of type object|string, array given

Thrown in : nativephp\laravel\src\Events\EventWatcher.php:22

Expected Fix

Add the below code on nativephp\laravel\src\Events\EventWatcher.php:18

if(!is_object($event)) {
    return;
}

Package Versions

nativephp/electron:0.7.3 nativephp/laravel:0.5.7 nativephp/php-bin:0.5.4

PHP Version

8.2

Laravel Version

11.27.2

Which operating systems have you seen this occur on?

Windows

OS version

10

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions