#NPE

1 messages · Page 1 of 1 (latest)

final sandal
#

What is at NethPotClickListener.java:63

sacred gate
#
                String invstring = data.getInventory(P.getUniqueId(),"NETHPOTINV");
                System.out.println(invstring);
                SerializeInventory.fromBase64(invstring);
final sandal
#

send a paste of the events class

#

Sorry I'm scattered I was working on my own project

sacred gate
#

hold on i am also scattered haha

#

i am talking to two people at the same time trying to fix this lol

final sandal
#

there is no doubt something is up with your sql quieries and config gets

data.getInventory(P.getUniqueId(),"NETHPOTINV");``` 
is returning null from the config get
```java
CallousConfig.getString("Default"+stat+"InventoryContents");
#

somethings wrong with your config getter / storage

sacred gate
#

the config

#

and it returns what it is supposed to return

final sandal
#

thats contradictory

#

try recompiling

sacred gate
#

i misworded what i was saying

#

i printed the config from inside of the getinventory and it returned what i was supposed to

#
    public String getInventory(UUID uuid,String stat){
        Configuration CallousConfig = CallousPvP.getInstance().getConfig();
        try{
            PreparedStatement ps = plugin.SQL.getConnection().prepareStatement("SELECT " + stat + " FROM callouspvp WHERE UUID=?");
            ps.setString(1,uuid.toString());
            ResultSet rs = ps.executeQuery();
            System.out.println(stat);
            String stats = CallousConfig.getString("Default"+stat+"InventoryContents");
            System.out.println(stats);
            if (rs.next()){
                stats = rs.getString(stat);
                System.out.println(stats);
                System.out.println("r2");
                return stats;
            }
        }catch (SQLException e){
            e.printStackTrace();
        }
        System.out.println(CallousConfig.getString("Default"+stat+"InventoryContents"));
        System.out.println("r1");
        return CallousConfig.getString("Default"+stat+"InventoryContents");
    }
final sandal
#

thats super fucking weird

#

I'm probably missing something

sacred gate
#

although getinventory still returns null

final sandal
#

okay

#

so do this inside get inventory

#
String temp = CallousConfig.getString("Default"+stat+"InventoryContents");
System.out.println(temp);
return temp;
#

because I believe your bath is wrong temp should return null and it should then return null to the outer method