Explorar o código

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

MaiXinRong %!s(int64=9) %!d(string=hai) anos
pai
achega
d7c2b13768
Modificáronse 1 ficheiros con 4 adicións e 0 borrados
  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;