Check for null values before destroying displays.

This addresses issue #1559.