From 1c9f5af2ca81e26996dfca7196b51f326a41f622 Mon Sep 17 00:00:00 2001 From: michael Date: Mon, 24 Jun 2019 10:22:26 +0000 Subject: [PATCH] Fix error if no connection found, and adapt load/save to changed verb indexes git-svn-id: trunk@61454 - --- components/sqldbrest/reglazsqldbrest.pp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/components/sqldbrest/reglazsqldbrest.pp b/components/sqldbrest/reglazsqldbrest.pp index 041e57b93d..47834feb7a 100644 --- a/components/sqldbrest/reglazsqldbrest.pp +++ b/components/sqldbrest/reglazsqldbrest.pp @@ -503,7 +503,8 @@ begin try Frm.Schema:=S; cList:=GetSchemaConnections(S); - Frm.Connections:=cList; + if Assigned(cList) then + Frm.Connections:=cList; if Frm.ShowModal=mrOK then begin if Frm.SchemaModified then @@ -520,6 +521,9 @@ end; procedure TSQLDBRestSchemaComponentEditor.ExecuteVerb(Index: Integer); +Const + idxSave = 2; + Var FN : UTF8String; S : TSQLDBRestSchema; @@ -531,8 +535,8 @@ begin 1,2 : begin FN:=Component.Name+'.json'; - if GetFileName(FN, Format(SJSONFilesFilter, [allFilesMask]), Index=0) then - if Index=0 then + if GetFileName(FN, Format(SJSONFilesFilter, [allFilesMask]), Index=idxSave) then + if idxSave=2 then S.SaveToFile(FN) else begin