Adds file exist checks

This commit is contained in:
Shannon
2017-10-06 11:51:27 +11:00
parent 7b3f7f4ad4
commit bee75803f7

View File

@@ -82,21 +82,23 @@ namespace Umbraco.Core
RequiresRescanning = (CachedAssembliesHash != CurrentAssembliesHash) || CachedAssembliesHash == string.Empty;
//if they have changed, we need to write the new file
if (RequiresRescanning)
{
// if the hash has changed, clear out the persisted list no matter what, this will force
// rescanning of all plugin types including lazy ones.
// http://issues.umbraco.org/issue/U4-4789
File.Delete(pluginListFile);
{
// if the hash has changed, clear out the persisted list no matter what, this will force
// rescanning of all plugin types including lazy ones.
// http://issues.umbraco.org/issue/U4-4789
if(File.Exists(pluginListFile))
File.Delete(pluginListFile);
WriteCachePluginsHash();
}
}
else
{
// if the hash has changed, clear out the persisted list no matter what, this will force
// rescanning of all plugin types including lazy ones.
{
// if the hash has changed, clear out the persisted list no matter what, this will force
// rescanning of all plugin types including lazy ones.
// http://issues.umbraco.org/issue/U4-4789
File.Delete(pluginListFile);
if (File.Exists(pluginListFile))
File.Delete(pluginListFile);
// always set to true if we're not detecting (generally only for testing)
RequiresRescanning = true;