protect output

This commit is contained in:
David Rose 2007-02-12 19:12:57 +00:00
parent 0e1ea07313
commit 1bf44ee2d7

View File

@ -103,7 +103,12 @@ safe_to_combine() const {
////////////////////////////////////////////////////////////////////
void CharacterJointEffect::
output(ostream &out) const {
out << get_type() << "(" << _character->get_name() << ")";
out << get_type();
if (_character.is_valid_pointer()) {
out << "(" << _character->get_name() << ")";
} else {
out << "(**invalid**)";
}
}
////////////////////////////////////////////////////////////////////