Fix exception in case of nil data