fix segfault with non-standard distortion models

D is not guaranteed to contain elements. Just ignore it in this case.