diff --git a/PaintingPC/FrmQuality.cs b/PaintingPC/FrmQuality.cs index cf21b23..340996a 100644 --- a/PaintingPC/FrmQuality.cs +++ b/PaintingPC/FrmQuality.cs @@ -571,7 +571,20 @@ namespace PaintingPC /// bool CheckColor(ref string colorName,ref string partName) { - string[] ss = labProductInfo.Text.Split(','); + string[] ss = null; + if (string.IsNullOrEmpty(labProductInfo.Text)) + { + MessageBox.Show("颜色信息有误,请重新扫描"); + return false; + } + if (labProductInfo.Text.Contains(",")) + { + ss = labProductInfo.Text.Split(','); + } + else + { + ss = labProductInfo.Text.Split(','); + } if (ss.Length >= 1) { if (string.IsNullOrWhiteSpace(ss[0])) @@ -582,7 +595,7 @@ namespace PaintingPC } else { - MessageBox.Show("条码有误,请重新扫描"); + MessageBox.Show("颜色信息有误1,请重新扫描"); return false; } colorName = ss[0];