Check navBarHidden is not nil before using it