I don't understand why I get a NullPointerException

Discussion in 'Spigot Plugin Help' started by PhilZockt, Jul 15, 2021.

  1. So if I execute this code

    public boolean contains(String path) {
    return config.contains(path);
    }

    I will get
    java.lang.NullPointerException: Cannot invoke "utils.Config.contains(String)" because "this.config" is null

    but shouldn't it just return false or true?

    I know that the config is empty but what can I do about it?

    Thanks in advance :)
     
  2. Nevermind I fixed the issue.