Skip to content

Commit 7780f46

Browse files
committed
Exception handling
1 parent 83293f9 commit 7780f46

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

ColorSetKit/ColorSet.cs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,16 @@ public static ColorSet Shared
7373
}
7474
else
7575
{
76-
System.Resources.ResourceManager manager = new System.Resources.ResourceManager( name.Name + ".Properties.Resources", assembly );
77-
78-
SharedInstance = !( manager.GetObject( "Colors" ) is byte[] data ) || data.Length == 0 ? new ColorSet() : new ColorSet( new Data( data ) );
76+
try
77+
{
78+
System.Resources.ResourceManager manager = new System.Resources.ResourceManager( name.Name + ".Properties.Resources", assembly );
79+
80+
SharedInstance = !( manager.GetObject( "Colors" ) is byte[] data ) || data.Length == 0 ? new ColorSet() : new ColorSet( new Data( data ) );
81+
}
82+
catch
83+
{
84+
SharedInstance = new ColorSet();
85+
}
7986
}
8087
}
8188

0 commit comments

Comments
 (0)