Fix handling of null userData