Fix NuGet/NuGetGallery#1901 by adding ye olde null-check

Fixes NuGet/NuGetGallery#1901