[#664] Fix NPE when no `sourceId` exists