Skip to content

Exception in DeeplTranslationService: Call to a member function listGlossaries() on null #61

@typoworx-de

Description

@typoworx-de

We have on a dev/live system similar issue. Sometimes for some reason this happens (even though deepl works usually).

As protected ?Translator $translator = null; is declared nullable, you should never expect trustfully that the service is available.

You should harden the code here:

    public function listGlossaries(): array
    {
        return $this->translator?->listGlossaries() ?? []];
    }

See:
https://github.com/dmitryd/dd_deepl/blob/v13.1.2/Classes/Service/DeeplTranslationService.php#L323

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions