浏览代码

Prevent crashing

Ruben 5 年之前
父节点
当前提交
3cc41086b9
共有 1 个文件被更改,包括 4 次插入5 次删除
  1. 4 5
      PicView/Editing/Color_Picking.cs

+ 4 - 5
PicView/Editing/Color_Picking.cs

@@ -1,12 +1,8 @@
 using PicView.Library;
-using PicView.SystemIntegration;
 using PicView.UI;
 using PicView.UI.Loading;
 using PicView.UI.TransformImage;
 using PicView.UI.UserControls;
-using System;
-using System.Collections.Generic;
-using System.Text;
 using System.Windows;
 using System.Windows.Controls;
 using System.Windows.Input;
@@ -55,7 +51,10 @@ namespace PicView.Editing
             Fields.TheMainWindow.Cursor = Cursors.Arrow;
 
             // Hide it
-            UC.GetColorPicker.Opacity = 0;
+            if (UC.GetColorPicker != null)
+            {
+                UC.GetColorPicker.Opacity = 0;
+            }
 
             // Set values, if needed
             if (setText)