MaiXinRong 5 lat temu
rodzic
commit
c235365b12
1 zmienionych plików z 2 dodań i 2 usunięć
  1. 2 2
      Frames/BillsCompileFme.pas

+ 2 - 2
Frames/BillsCompileFme.pas

@@ -366,7 +366,7 @@ end;
 procedure TBillsCompileFrame.actnBatchAddChildUpdate(Sender: TObject);
 begin
   with stdBillsCompile.IDTree do
-    TAction(Sender).Enabled := not Selected.HasChildren
+    TAction(Sender).Enabled := Assigned(Selected) and not Selected.HasChildren
         and (Selected.Rec.ValueByName('Code').AsString <> '');
 end;
 
@@ -548,7 +548,7 @@ procedure TBillsCompileFrame.actnImportGclBillsToXmjUpdate(
   Sender: TObject);
 begin
   with stdBillsCompile.IDTree do
-    TAction(Sender).Enabled := not Selected.HasChildren and (Selected.Rec.ValueByName('Code').AsString <> '');
+    TAction(Sender).Enabled := Assigned(Selected) and not Selected.HasChildren and (Selected.Rec.ValueByName('Code').AsString <> '');
 end;
 
 procedure TBillsCompileFrame.actnImportGclBillsToXmjExecute(