Add emptiness check in copyPointCloud()

This fixes #932 and adds a unit test.