Browse files

Silly null references

  • Loading branch information...
1 parent 5151f59 commit 16723b7e057b4158935124ed1b88749824a3ee31 @citizenmatt citizenmatt committed Nov 20, 2012
Showing with 5 additions and 5 deletions.
  1. +4 −4 src/resharper-nuget/NuGetApi.cs
  2. +1 −1 src/resharper-nuget/NuGetModuleReferencer.cs
View
8 src/resharper-nuget/NuGetApi.cs
@@ -58,9 +58,9 @@ private bool IsNuGetAvailable
get { return vsPackageInstallerServices != null && vsPackageInstaller != null; }
}
- public bool AreAnyAssemblyFilesNuGetPackages(IEnumerable<FileSystemPath> fileLocations)
+ public bool AreAnyAssemblyFilesNuGetPackages(IList<FileSystemPath> fileLocations)
{
- if (!IsNuGetAvailable)
+ if (!IsNuGetAvailable || fileLocations.Count == 0)
return false;
// We're talking to NuGet via COM. Make sure we're on the UI thread
@@ -73,9 +73,9 @@ public bool AreAnyAssemblyFilesNuGetPackages(IEnumerable<FileSystemPath> fileLoc
return hasPackageAssembly;
}
- public string InstallNuGetPackageFromAssemblyFiles(IEnumerable<FileSystemPath> assemblyLocations, IProject project)
+ public string InstallNuGetPackageFromAssemblyFiles(IList<FileSystemPath> assemblyLocations, IProject project)
{
- if (!IsNuGetAvailable)
+ if (!IsNuGetAvailable || assemblyLocations.Count == 0)
return null;
string installedAssembly = null;
View
2 src/resharper-nuget/NuGetModuleReferencer.cs
@@ -82,7 +82,7 @@ private static IList<FileSystemPath> GetAllAssemblyLocations(IPsiModule psiModul
{
var projectModelAssembly = psiModule.ContainingProjectModule as IAssembly;
if (projectModelAssembly == null)
- return null;
+ return EmptyList<FileSystemPath>.InstanceList;
// ReSharper maintains a list of unique assemblies, and each assembly keeps a track of
// all of the file copies of itself that the solution knows about. This list of file

0 comments on commit 16723b7

Please sign in to comment.