Check data with isset() before accessing it.

Don't blindly access data that may not exist.

Fixes #2712