Skip to content

Commit 2178b33

Browse files
authored
Merge pull request #792 from johncbaur/VIX-3827
VIX-3827 Suppressed exception on Fixture clone
2 parents ec791c7 + 3d2a8a2 commit 2178b33

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

src/Vixen.Modules/App/ColorGradients/ColorGradient.cs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,13 +287,22 @@ public ColorGradient(ColorGradient other)
287287
public ColorGradient(Color staticColor)
288288
: this()
289289
{
290+
if (staticColor == null)
291+
{
292+
throw new ArgumentNullException(nameof(staticColor));
293+
}
290294
_colors.Clear();
291295
_colors.Add(new ColorPoint(staticColor, 0));
292296
}
293297

294298
public ColorGradient(IEnumerable<Color> colors)
295299
: this()
296300
{
301+
if (colors == null)
302+
{
303+
throw new ArgumentNullException(nameof(colors));
304+
}
305+
297306
_colors.Clear();
298307
foreach (Color c in colors) {
299308
_colors.Add(new ColorPoint(c, 0));
@@ -878,6 +887,11 @@ public object Clone()
878887
/// <param name="other"></param>
879888
public void CloneFrom(ColorGradient other)
880889
{
890+
if (other == null)
891+
{
892+
throw new ArgumentNullException(nameof(other));
893+
}
894+
881895
CloneDataFrom(other);
882896

883897
// grab all the library-linking details as well
@@ -891,6 +905,11 @@ public void CloneFrom(ColorGradient other)
891905
/// <param name="other"></param>
892906
public void CloneDataFrom(ColorGradient other)
893907
{
908+
if (other == null)
909+
{
910+
throw new ArgumentNullException(nameof(other));
911+
}
912+
894913
_colors = new PointList<ColorPoint>();
895914
foreach (ColorPoint cp in other.Colors) {
896915
_colors.Add(new ColorPoint(cp));

src/Vixen.Modules/Effect/Fixture/FixtureEffect/Data/FixtureFunctionData.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ public FixtureFunctionData()
2222
FunctionIdentity = FunctionIdentity.Custom;
2323
FunctionName = String.Empty;
2424
Range = new Curve(new PointPairList(new[] { 0.0, 100.0 }, new[] { 0.0, 0.0 }));
25-
TimelineColor = System.Drawing.Color.White;
25+
TimelineColor = System.Drawing.Color.White;
26+
Color = new App.ColorGradients.ColorGradient();
2627
}
2728

2829
#endregion
@@ -108,7 +109,7 @@ public FixtureFunctionData CreateInstanceForClone()
108109
[OnDeserialized]
109110
public void OnDeserialized(StreamingContext c)
110111
{
111-
//Ensure Color is populated
112+
// Ensure Color is populated
112113
Color ??= new App.ColorGradients.ColorGradient();
113114
}
114115

0 commit comments

Comments
 (0)