1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

Invalid argument??

Discussion in 'Development' started by TheArticGlider, Mar 31, 2018.

  1. TheArticGlider

    TheArticGlider Creeper

    Messages:
    3
    Hi, when I start the advanced kits plugin, modified by me, I receive this error in console:

    [Server] Server thread/INFO Enabling AdvancedKits v5.1.1
    [Server] Server thread/CRITICAL ErrorException: "Invalid argument supplied for foreach()" (EXCEPTION) in "AdvancedKits_dev-23.phar/src/AdvancedKits/Main" at line 96
    [Server] Server thread/DEBUG #0 AdvancedKits_dev-23.phar/src/AdvancedKits/Main(96): pocketmine\error_handler(integer 2, string Invalid argument supplied for foreach(), string phar:///plugins/AdvancedKits_dev-23.phar/src/AdvancedKits/Main.php, integer 96, array Array())


    The code for the line which is probably causing the issue is this:
    private function fixConfig(&$config){
    foreach($config as $name => $kit){
    if(isset($kit["users"])){
    $users = array_map("strtolower", $kit["users"]);
    $config[$name]["users"] = $users;


    Could someone please say what is going wrong here
     
  2. korado531m7

    korado531m7 Slime

    Messages:
    77
    GitHub:
    korado531m7
    $config is an array?
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.