Restructure overly agressive Q_ASSERT

Turns out this function can be called when there is no valid dive - so
only protect those parts that dereference the dive.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>