Fix for File Not Found exception while indexing invalid Package App (#4971)

* Catching file not found exception

* removed unnecessary header files

* Added a string.empty check for installed location

* reusing package wrapper instead of package installing event args
This commit is contained in:
Alekhya
2020-07-14 11:44:50 -07:00
committed by GitHub
parent 74412766fa
commit f59abe23c3
3 changed files with 45 additions and 12 deletions

View File

@@ -35,11 +35,14 @@ namespace Microsoft.Plugin.Program.Storage
try
{
var packageWrapper = PackageWrapper.GetWrapperFromPackage(args.Package);
var uwp = new UWP(packageWrapper);
uwp.InitializeAppInfo(args.Package.InstalledLocation.Path);
foreach (var app in uwp.Apps)
if(!string.IsNullOrEmpty(packageWrapper.InstalledLocation))
{
Add(app);
var uwp = new UWP(packageWrapper);
uwp.InitializeAppInfo(packageWrapper.InstalledLocation);
foreach (var app in uwp.Apps)
{
Add(app);
}
}
}
//InitializeAppInfo will throw if there is no AppxManifest.xml for the package.