Palente / SeeDevice

A pmmp plugin for Minecraft(W10,BE) [PHP]
GNU General Public License v3.0
14 stars 4 forks source link

Crash, unidentified int 96 in the array listOfOs #9

Open dadodasyra opened 3 years ago

dadodasyra commented 3 years ago
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;
    }