Example here:
https://groups.google.com/forum/#!topic/nat-user/Oe40-OjRDd8
Paavo also had the same error recently. Happens when nabor::knn is called with matrix containing 0 rows. Maybe nat.nblast:::WeightedNNBasedLinesetMatching.default should return NA if either of the inputs have 0 rows.