Skip to content

Crash, unidentified int 96 in the array listOfOs #9

Description

@dadodasyra
PocketMine-MP Crash Dump Tue Feb 23 02:33:05 CET 2021

Error: Undefined offset: 69
File: plugins/SeeDevice-master/src/Palente/SeeDevice/SeeDevice
Line: 96
Type: ErrorException

Line 93 - 97

    public function getPlayerOs(Player $player): ?string
    {
        if (!isset($this->os[$player->getName()]) or $this->os[$player->getName()] === null) return null;
        return $this->listOfOs[$this->os[strtolower($player->getName())]] ;
    }

Purpose of solution:

    public function getPlayerOs(Player $player): ?string
    {
        if (!isset($this->os[$player->getName()]) or $this->os[$player->getName()] === null) return null;
        return $this->listOfOs[$this->os[strtolower($player->getName())]] ?? null;
    }

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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