Checking a nillable type prior to passing it to a function which expects it to not be nil

Just wanted to follow up by saying thank you both once more.

I have to admit and apologize that when I posted this I didn’t do a forum search for similar posts (after revisiting my post today and clicking through a few more older posts I eventually found a similar thread where the OP ran into the same situation which I posted about: Nil checks demistifaction)

My hastiness was born out of frustration in the moment.

Not only am I new to Crystal, but to regularly programming in a Static programming language in general; so there’s always the thought in the back of my mind of not knowing whether the issue I’ve run into at the moment that’s impeding forward progress is due to my lack of knowledge or some obscure edge case that just may not have been discovered in the language yet (more times than not it will be the first, but just due to how new Crystal is, I can’t rule out the second without asking those more experienced than myself).

So thank you once again, the fast response time was really quite surprising for me.

And next time I post, I’ll be sure to have done my due diligence on the forums and at least post the links I’ve found which may have been somewhat close to my query, but fall short in getting me to the answer I’m seeking additional input from someone more experienced.

4 Likes