How to change value of text in a widget blueprint from c++

Just wanting to say for anyone else that has their game crash you must check if your widget is not null before setting the variable. Spent a couple of minutes trying to figure it out.