Fix potential crash when text is nil

I was seeing seldom crashes here, this is an easy fix to prevent those.