Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java.lang.NullPointerException: listFood.get(0) must not be null #57

Open
betodev98 opened this issue Dec 4, 2022 · 1 comment
Open

Comments

@betodev98
Copy link

betodev98 commented Dec 4, 2022

fun insertFood(item: FoodDomain){

    listFood = tinyDB.getListObject("CartList")
    listFood.add(item)
    tinyDB.putListObject("CartList",listFood)
    var fod : FoodDomain = listFood.get(0)
    }

The error is: when i get the list, it have size, 1 or 2 or 3 , is normal; but if i want get one object of the list, it say "must not be null"

like IS A LIST WITH SIZE BUT ALL OBJECT ARE NULL OR NOT EXIST ? please help :c i have this problem 2 months

@kcochibili
Copy link
Owner

Hello, can you share the error log for the crash? it will help me find out what the problem is and how to solve it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants