fix null pointer when no apns are found for device