File tree Expand file tree Collapse file tree 1 file changed +11
-13
lines changed
Rubberduck.SettingsProvider Expand file tree Collapse file tree 1 file changed +11
-13
lines changed Original file line number Diff line number Diff line change @@ -51,23 +51,21 @@ protected static T FailedLoadReturnValue()
51
51
52
52
protected static XDocument GetConfigurationDoc ( string file )
53
53
{
54
- if ( ! File . Exists ( file ) )
55
- {
56
- return new XDocument ( ) ;
57
- }
58
-
59
54
XDocument output ;
60
- try
55
+ if ( File . Exists ( file ) )
61
56
{
62
- output = XDocument . Load ( file ) ;
63
- if ( output . Descendants ( ) . FirstOrDefault ( e => e . Name . LocalName . Equals ( RootElement ) ) != null )
57
+ try
64
58
{
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.
66
68
}
67
- }
68
- catch
69
- {
70
- // this is fine - we'll just return an empty XDocument.
71
69
}
72
70
73
71
output = new XDocument ( ) ;
You can’t perform that action at this time.
0 commit comments