Fix possible NULL dereference (savannah bug #55369)