aboutsummaryrefslogtreecommitdiff
path: root/ShiftOS.WinForms/Applications
diff options
context:
space:
mode:
authorMichael <[email protected]>2017-06-13 16:39:31 -0400
committerMichael <[email protected]>2017-06-13 16:39:37 -0400
commitcd30c8a9ffa87990f718d2f62eb3d8a376f5bd4e (patch)
tree072d48add47f605b84f07685e5e5a4732dab073a /ShiftOS.WinForms/Applications
parent7dcde1c752109f47f098274a228ba3bf228430c4 (diff)
downloadshiftos_thereturn-cd30c8a9ffa87990f718d2f62eb3d8a376f5bd4e.tar.gz
shiftos_thereturn-cd30c8a9ffa87990f718d2f62eb3d8a376f5bd4e.tar.bz2
shiftos_thereturn-cd30c8a9ffa87990f718d2f62eb3d8a376f5bd4e.zip
Fix Graphic Picker nullreference bug
Diffstat (limited to 'ShiftOS.WinForms/Applications')
-rw-r--r--ShiftOS.WinForms/Applications/GraphicPicker.cs9
1 files changed, 6 insertions, 3 deletions
diff --git a/ShiftOS.WinForms/Applications/GraphicPicker.cs b/ShiftOS.WinForms/Applications/GraphicPicker.cs
index f299f0d..2a31815 100644
--- a/ShiftOS.WinForms/Applications/GraphicPicker.cs
+++ b/ShiftOS.WinForms/Applications/GraphicPicker.cs
@@ -46,10 +46,13 @@ namespace ShiftOS.WinForms.Applications
InitializeComponent();
SelectedLayout = layout;
Image = old;
- using(var ms = new System.IO.MemoryStream())
+ if (Image != null)
{
- Image.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
- ImageAsBinary = ms.ToArray();
+ using (var ms = new System.IO.MemoryStream())
+ {
+ Image.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
+ ImageAsBinary = ms.ToArray();
+ }
}
Callback = cb;
lblobjecttoskin.Text = name;