Fix traceback in peer publish system

This fixes #5958 by adding a default value for the call to getattr().