I have a Database class which consists of the following code: ```java package me.lewd.poke.database; import me.lewd.poke.Main; import org.dizitart.no2.Nitrite; import org.dizitart.no2.NitriteCollection; public class Database { public Nitrite db; public NitriteCollection pokes; private String dataFolder = Main.instance.getDataFolder().getAbsolutePath(); public void startDatabase() { db = Nitrite.builder() .filePath(dataFolder + "/data/pokes.db") .openOrCreate(); pokes = db.getCollection("pokes"); } public Nitrite getDatabase() { return db; } public NitriteCollection getCollection() { return pokes; } public void closeDatabase() { if (db.hasUnsavedChanges()) db.commit(); if (!db.isClosed()) db.close(); } } ``` The startDatabase() method is called on start. whenever I use the getCollection() method I get this error ``` java.lang.NullPointerException: Cannot invoke "org.dizitart.no2.NitriteCollection.find(org.dizitart.no2.Filter)" because "collection" is null ``` Using nitrite 3.4.4
Activity
anidotnet commentedon Oct 17, 2022
Which version of JDK are you using? And please paste full stacktrace here.