fix an npe in the pub builder

Fixes #1626. @ussuri