diff --git a/ProductionMgr/Tnb.ProductionMgr/PrdMoTaskService.cs b/ProductionMgr/Tnb.ProductionMgr/PrdMoTaskService.cs index 0d1ecbf2..48a508ae 100644 --- a/ProductionMgr/Tnb.ProductionMgr/PrdMoTaskService.cs +++ b/ProductionMgr/Tnb.ProductionMgr/PrdMoTaskService.cs @@ -3059,6 +3059,10 @@ namespace Tnb.ProductionMgr foreach (var prdMoTask in list) { BasMaterial basMaterial = await _db.Queryable().SingleAsync(x => x.id == prdMoTask.material_id); + if (basMaterial == null) + { + throw Oops.Bah($"找不到物料{prdMoTask.material_id}"); + } prdMoTask.material_name = basMaterial.name; } }