Use depsgraph's objects iterator to find sources of dupliobjects, instead of looping over bases of a viewlayer.