Solved Null checks with the PermissionsEx API

Discussion in 'Spigot Plugin Development' started by Webmets, Apr 14, 2017.

  1. Hi, currently I am making a plugin with the PermissionsEx API, and so far so good. I can hook in to the api, make sure the plugin is loaded and it all works just fine.

    how ever, when I try to cast a PermissionsUser
    Code (Text):
    PermissionUser user = PermissionsEx.getUser(player);
    I was unable to find any JavaDocs in this method. if I want to use this should I add specific null-checks,
    or will
    Code (Text):
    PermissionsEx.getUser(player);
    always return something, thus not needing a null check

    Thanks in advance,
    - Webmets
     
  2. Well, just make sure 'player' isn't null then it should be fine.
     
    • Informative Informative x 1
    • Informative Informative x 1
  3. Thank's for the help :)