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

api3/network Crash getAttribute() #496

Closed
RompeCraneos opened this issue Mar 31, 2017 · 1 comment
Closed

api3/network Crash getAttribute() #496

RompeCraneos opened this issue Mar 31, 2017 · 1 comment
Labels
Category: Core Related to internal functionality Resolution: Duplicate

Comments

@RompeCraneos
Copy link

Issue description

Crash:
30.03 23:04:50 [Server] Server thread/EMERGENCY An unrecoverable error has occurred and the server has crashed. Creating a crash dump
30.03 23:04:50 [Server] Server thread/CRITICAL Error: "Call to a member function getAttribute() on null" (EXCEPTION) in "/src/pocketmine/entity/Human" at line 103

Steps to reproduce the issue

Random Crash every 5 - 15 minutes

OS and versions

  • PocketMine-MP: 1.6.2dev #0 [Protocol 105; API 3.0.0-ALPHA5]
  • PHP: 7.0.15
  • Server OS: Linux, linux
  • Game version: PE/Win10

Crashdump, backtrace or other files

Error: Call to a member function getAttribute() on null
File: /src/pocketmine/entity/Human
Line: 103
Type: notice

Code:
[94] * @param string $str
[95] * @param string $skinId
[96] /
[97] public function setSkin($str, $skinId){
[98] $this->skin = $str;
[99] $this->skinId = $skinId;
[100] }
[101]
[102] public function getFood() : float{
[103] return $this->attributeMap->getAttribute(Attribute::HUNGER)->getValue();
[104] }
[105]
[106] /
*
[107] * WARNING: This method does not check if full and may throw an exception if out of bounds.
[108] * Use {@link Human::addFood()} for this purpose
[109] *
[110] * @param float $new
[111] *
[112] * @throws \InvalidArgumentException
[113] */

Backtrace:
#0 /src/pocketmine/entity/Human(411): pocketmine\entity\Human->getFood(boolean)
#1 /src/pocketmine/Player(3681): pocketmine\entity\Human->saveNBT(boolean)
#2 /src/pocketmine/Server(2272): pocketmine\Player->save(boolean 1)
#3 /src/pocketmine/Server(2419): pocketmine\Server->doAutoSave(boolean)
#4 /src/pocketmine/Server(2152): pocketmine\Server->tick(boolean)
#5 /src/pocketmine/Server(2035): pocketmine\Server->tickProcessor(boolean)
#6 /src/pocketmine/Server(1655): pocketmine\Server->start(boolean)
#7 /src/pocketmine/PocketMine(493): pocketmine\Server->__construct(BaseClassLoader object, pocketmine\utils\MainLogger object, string phar:///home/minecraft/multicraft/servers/server1162/custom-phar.phar/, string /home/minecraft/multicraft/servers/server1162/, string /home/minecraft/multicraft/servers/server1162/plugins/)
#8 (1): require_once(string phar:///home/minecraft/multicraft/servers/server1162/custom-phar.phar/src/pocketmine/PocketMine.php)

@RompeCraneos RompeCraneos changed the title Crash getAttribute() Crash getAttribute() api3/network Mar 31, 2017
@RompeCraneos RompeCraneos changed the title Crash getAttribute() api3/network api3/network Crash getAttribute() Mar 31, 2017
@Sandertv
Copy link
Contributor

Sandertv commented Mar 31, 2017

FACEPALM - Could you please look at previous issues? This is like the fourth of these issues, and is already fixed in the latest commit.

@dktapps dktapps closed this as completed Mar 31, 2017
@dktapps dktapps added Category: Core Related to internal functionality Resolution: Duplicate labels Mar 31, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Core Related to internal functionality Resolution: Duplicate
Projects
None yet
Development

No branches or pull requests

3 participants