Checking for nulls in onresume