This commit adds a check that should prevent crashes of the kind that were occurring in the report description from happening. However, I couldn't verify yet whether this really works, since it appears the bug has temporarily disappeared in recent svn. Just in case, I've committed this fix, and we can revert/improve if the bug returns.