fix segfault with non-standard distortion models

D is not guaranteed to contain elements.
Just ignore it in this case.
Merge pull request #3 from v4hn/non-standard-distortion

fix segfault with non-standard distortion models