Browse Source

Bug #888 查找定位,定位空白行报错

MaiXinRong 9 năm trước cách đây
mục cha
commit
d7c2b13768
1 tập tin đã thay đổi với 4 bổ sung0 xóa
  1. 4 0
      DataModules/SearchDm.pas

+ 4 - 0
DataModules/SearchDm.pas

@@ -93,6 +93,8 @@ procedure TSearchData.LocateCurrent(ALocateType: TLocateType);
     with TProjectData(FProjectData).BillsCompileData do
     begin
       stnNode := BillsCompileTree.FindNode(cdsSearchID.AsInteger);
+      if not Assigned(stnNode) then Exit;
+
       sdvBillsCompile.LocateInControl(stnNode.Rec);
     end;
   end;
@@ -104,6 +106,8 @@ procedure TSearchData.LocateCurrent(ALocateType: TLocateType);
     with TProjectData(FProjectData).BillsMeasureData do
     begin
       stnNode := BillsMeasureTree.FindNode(cdsSearchID.AsInteger);
+      if not Assigned(stnNode) then Exit;
+
       sdvBillsMeasure.LocateInControl(stnNode.Rec);
     end;
   end;