diff --git a/Rs.SkyLine/Commom/NozzleCollection.cs b/Rs.SkyLine/Commom/NozzleCollection.cs index 2ac6592..9af5fbd 100644 --- a/Rs.SkyLine/Commom/NozzleCollection.cs +++ b/Rs.SkyLine/Commom/NozzleCollection.cs @@ -193,7 +193,13 @@ namespace Rs.MotionPlat.Commom { if (nozzles != null && nozzles.Count > 0) { - return nozzles.Where(n => n.Status == ENozzleStatus.ToUnload).OrderBy(o=>o.ToType).First(); + var nozzlelist = nozzles.Where(n => n.Status == ENozzleStatus.ToUnload); + if (nozzlelist != null && nozzlelist.Count() > 0) + { + return nozzles.Where(n => n.Status == ENozzleStatus.ToUnload).OrderBy(o => o.ToType).First(); + } + else + return null; } return null; }