Fix crash in chanspy (bug #5332)