Fix potential null reference error for post data

* Fix potential null reference error preparing data to post after button
click