diff --git a/PEIS/View/Setting/HazardTypeForm.cs b/PEIS/View/Setting/HazardTypeForm.cs index 8470c3f..0873839 100644 --- a/PEIS/View/Setting/HazardTypeForm.cs +++ b/PEIS/View/Setting/HazardTypeForm.cs @@ -150,7 +150,11 @@ namespace PEIS.View.Setting { int hazardTypeIndex = gVHazardType.FocusedRowHandle; var hazardTypeRow = gVHazardType.GetRow(hazardTypeIndex) as DictHazardType; - GetHTypeFItem?.Invoke(this, new Args() { Eid = hazardTypeRow.ID }); + if (hazardTypeRow!=null) + { + GetHTypeFItem?.Invoke(this, new Args() { Eid = hazardTypeRow.ID }); + } + } private void TsmiDelete_Click(object sender, EventArgs e) {