WolfDen133 / WFT

Recoded, added features, removed useless stuff, more efficent code, PER PLAYER TEXT
GNU General Public License v3.0
10 stars 7 forks source link

Error #26

Closed cherrychip8293 closed 2 months ago

cherrychip8293 commented 9 months ago

str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated File: plugins/WFT.phar/src/WolfDen133/WFT/Utils/Utils Line: 59 Type: ErrorException Backtrace:

0 (): pocketmine\errorhandler\ErrorToExceptionHandler::handle(int 8192, string[89] str_replace(): Passing null to parameter #2 ($replace) of type array|string is d, string[72] phar:///home/user/pm/plugins/WFT.phar/src/WolfDen133/WFT/Utils/Utils.php, int 59)

1 plugins/WFT.phar/src/WolfDen133/WFT/Utils/Utils(59): str_replace(string[6] {PING}, null, string[39] ..l......... 2......... ...............)

2 plugins/WFT.phar/src/WolfDen133/WFT/Texts/SubText(60): WolfDen133\WFT\Utils\Utils::getFormattedText(string[39] ..l......... 2......... ..............., object pocketmine\player\Player#337651)

3 plugins/WFT.phar/src/WolfDen133/WFT/Texts/FloatingText(92): WolfDen133\WFT\Texts\SubText->updateTextTo(object pocketmine\player\Player#337651)

4 plugins/WFT.phar/src/WolfDen133/WFT/Task/UpdateTask(14): WolfDen133\WFT\Texts\FloatingText->updateTextTo(object pocketmine\player\Player#337651)

5 pmsrc/src/scheduler/TaskHandler(113): WolfDen133\WFT\Task\UpdateTask->onRun()

6 pmsrc/src/scheduler/TaskScheduler(137): pocketmine\scheduler\TaskHandler->run()

7 pmsrc/src/plugin/PluginManager(533): pocketmine\scheduler\TaskScheduler->mainThreadHeartbeat(int 487706)

8 pmsrc/src/Server(1791): pocketmine\plugin\PluginManager->tickSchedulers(int 487706)

9 pmsrc/src/Server(1680): pocketmine\Server->tick()

10 pmsrc/src/Server(1065): pocketmine\Server->tickProcessor()

11 pmsrc/src/PocketMine(341): pocketmine\Server->__construct(object pocketmine\thread\ThreadSafeClassLoader#3, object pocketmine\utils\MainLogger#6, string[14] /home/user/pm/, string[22] /home/user/pm/plugins/)

12 pmsrc/src/PocketMine(364): pocketmine\server()

13 pmsrc(11): require(string[58] phar:///home/user/pm/PocketMine-MP.phar/src/PocketMine.php)

WolfDen133 commented 9 months ago

Im going to need more information as I can't phisically see the problem with the code, can you include some steps to replicate?

Smorted commented 6 months ago

even me i got that same error, somehow its not reproducible but its about the ping of the player.

for now i fixed it potentially by checking !is_null first.