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

Function keeps returning boolean instead of array

Discussion in 'Development' started by HittmanA, Jul 18, 2017.

  1. HittmanA

    HittmanA Zombie

    Messages:
    207
    GitHub:
    hittmana
    I am working on a plugin and when I am testing it I keep getting an error I cannot solve.
    Code
    Error:
    Code:
    [23:18:20] [Server thread/CRITICAL]: Unhandled exception executing command 'f create Notgonnawork' in factionspp: Return value of HittmanA\factionspp\provider\YAMLProvider::getPlayer() must be of the type array, boolean returned
    
    [23:18:20] [Server thread/CRITICAL]: TypeError: "Return value of HittmanA\factionspp\provider\YAMLProvider::getPlayer() must be of the type array, boolean returned" (EXCEPTION) in "FPP/src/HittmanA/factionspp/provider/YAMLProvider" at line 41
    I have tried many ways of fixing the problem but I can't solve it.
     
  2. HittmanA

    HittmanA Zombie

    Messages:
    207
    GitHub:
    hittmana
  3. HittmanA

    HittmanA Zombie

    Messages:
    207
    GitHub:
    hittmana
    I did some testing and I found that the
    PHP:
    $player-getName()
    (Link) is returning false for some reason. Why is that?
     
  4. Awzaw

    Awzaw Zombie Pigman Poggit Admin

    Messages:
    726
    GitHub:
    awzaw
    What is the contents of factions.yml?
     
  5. HittmanA

    HittmanA Zombie

    Messages:
    207
    GitHub:
    hittmana
    Nothing which was the problem. Fixed it now.
     
  6. Awzaw

    Awzaw Zombie Pigman Poggit Admin

    Messages:
    726
    GitHub:
    awzaw
    Great, now you are supposed to post the answer for future reference, and mark as 'solved'.
     
    jasonwynn10 and Thunder33345 like this.
  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.