Fix a crash issue when attempting to draw invalid item.

This can happen when using UIItem as interfaces etc.