Added null check in getAllData() of select2