return null if data is nul or if array is empty