If cloud variable is null crashing app

Does anyone see anything inherently wrong with my blocks?
In the blocks ‘if history j not equal to null’ there are a few that don’t exist at all in Firebase, but I’m not sure why it’s not just simply excluding them for me and going onto the next object.

Any help is greatly appreciated

1 Like

I don’t think Firebase can store null values. So your list should just cycle through the available nodes in /!Jobs. What does your Firebase database look like? What happens if you remove the if block and just add items to the list for every item/node?

2 Likes

I get the same result if I don’t have that block.

There’s nothing special about the data, it goes

!Jobs

Job1

Field1
Field 2

Job2

Field1

1 Like

Why are you setting app variable Get DB as a List?

Firebase returns objects not lists, even if the dataset returned looks like a list. Better, set it to null.

You IF condition is not achievable anyway, whether you have it or not the blocks should act the same.

2 Likes

K I’ll start setting them to null.

So is there any way to negate objects that are non existent?

1 Like

In your code, the loop is constructed of a list of object properties and therefore you will never come across a property named null. This is why, with this IF condition, you are trying to catch an impossible case.

Only Get DB is initialised to null. Search List remains as a list.

2 Likes

So using get DB will do this properly?

1 Like

hmmm firebase apparently is true that it cannot store null values.image
It’s been resolved by me, because the same happened for me. so that try typing some “random text” in them. we can just replace the variables with a simple block.
image
depended, if you won’t believe me see the data
image

Yes.

Your only other source of possible crash is the app variable Temp Search by, if this key does not exist in the dataset then you will be attempting to add a null entry in your Search List which would crash the app.

1 Like

@muneer The same happened for me.

I don’t use the Get DB very often at all.
Did I assemble this correctly? Because nothing happens now with our without the ‘if’ block

By the way how do you make your text grayed like you do when you’re emphasizing it in your replies here?

2 Likes

I’m sorry, my comments must have confused you. I was referring to Get DB as the variable in your blocks. I didn’t mean to change from cloud to get block. The cloud variable is just fine.

To gray the text use the </> in the toolbar menu or use Ctrl-E when using the computer.

Hope this explains it better

1 Like

Perfect thanks, this did solve it!

2 Likes