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

Config file says "from.name" can be null, this is not true #8

Closed
filliph opened this issue Jan 14, 2020 · 2 comments · Fixed by #9
Closed

Config file says "from.name" can be null, this is not true #8

filliph opened this issue Jan 14, 2020 · 2 comments · Fixed by #9

Comments

@filliph
Copy link
Contributor

filliph commented Jan 14, 2020

    /*
     * The author of the log messages. You can set both to null to keep the Webhook author set in Discord
     */
    'from'       => [
        'name'       => 'Error Logger',
        'avatar_url' => null,
    ],

Results in this error message:

   Symfony\Component\Debug\Exception\FatalThrowableError  : Return value of MarvinLabs\DiscordLogger\Converters\AbstractRecordConverter::getFromName() must be of the type string, null returned

  at /var/www/html/prod/vendor/marvinlabs/laravel-discord-logger/src/DiscordLogger/Converters/AbstractRecordConverter.php:98
     94|     }
     95| 
     96|     protected function getFromName(): string
     97|     {
  >  98|         return $this->config->get('discord-logger.from.name');
     99|     }
    100| 
    101|     protected function getFromAvatar(): ?string
    102|     {

  Exception trace:

  1   MarvinLabs\DiscordLogger\Converters\AbstractRecordConverter::getFromName()
      /var/www/html/prod/vendor/marvinlabs/laravel-discord-logger/src/DiscordLogger/Converters/AbstractRecordConverter.php:87

  2   MarvinLabs\DiscordLogger\Converters\AbstractRecordConverter::addGenericMessageFrom(Object(MarvinLabs\DiscordLogger\Discord\Message))
      /var/www/html/prod/vendor/marvinlabs/laravel-discord-logger/src/DiscordLogger/Converters/RichRecordConverter.php:19

I'm guessing it should be : ?string like the avatar?

@vpratfr
Copy link
Member

vpratfr commented Jan 14, 2020

Hi

That could be. Could you submit a PR and test it?

@filliph
Copy link
Contributor Author

filliph commented Jan 14, 2020

Done, confirmed it works with this change.

vpratfr pushed a commit that referenced this issue Jan 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants