Skip to content

Commit f504ae2

Browse files
authored
Merge pull request #4817 from comintern/next
Settings hot-fix.
2 parents 56662a5 + abbf153 commit f504ae2

File tree

1 file changed

+11
-13
lines changed

1 file changed

+11
-13
lines changed

Rubberduck.SettingsProvider/XmlPersistanceServiceBase.cs

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -51,23 +51,21 @@ protected static T FailedLoadReturnValue()
5151

5252
protected static XDocument GetConfigurationDoc(string file)
5353
{
54-
if (!File.Exists(file))
55-
{
56-
return new XDocument();
57-
}
58-
5954
XDocument output;
60-
try
55+
if (File.Exists(file))
6156
{
62-
output = XDocument.Load(file);
63-
if (output.Descendants().FirstOrDefault(e => e.Name.LocalName.Equals(RootElement)) != null)
57+
try
6458
{
65-
return output;
59+
output = XDocument.Load(file);
60+
if (output.Descendants().FirstOrDefault(e => e.Name.LocalName.Equals(RootElement)) != null)
61+
{
62+
return output;
63+
}
64+
}
65+
catch
66+
{
67+
// this is fine - we'll just return an empty XDocument.
6668
}
67-
}
68-
catch
69-
{
70-
// this is fine - we'll just return an empty XDocument.
7169
}
7270

7371
output = new XDocument();

0 commit comments

Comments
 (0)