fix #178 - possible to insert unamed object in DUB json

This commit is contained in:
Basile Burg 2017-08-08 05:37:14 +02:00
parent 26b44a2f0e
commit b671bfe40e
No known key found for this signature in database
GPG Key ID: 1868039F415CB8CF
1 changed files with 8 additions and 3 deletions

View File

@ -8,7 +8,7 @@ uses
Classes, SysUtils, FileUtil, TreeFilterEdit, Forms, Controls, Graphics, Classes, SysUtils, FileUtil, TreeFilterEdit, Forms, Controls, Graphics,
Dialogs, ExtCtrls, Menus, StdCtrls, Buttons, ComCtrls, jsonparser, fpjson, Dialogs, ExtCtrls, Menus, StdCtrls, Buttons, ComCtrls, jsonparser, fpjson,
ce_widget, ce_common, ce_interfaces, ce_observer, ce_dubproject, ce_sharedres, ce_widget, ce_common, ce_interfaces, ce_observer, ce_dubproject, ce_sharedres,
ce_dsgncontrols; ce_dsgncontrols, ce_dialogs;
type type
@ -220,8 +220,13 @@ begin
1: tpe := TJSONtype.jtObject; 1: tpe := TJSONtype.jtObject;
else tpe := TJSONtype.jtString; else tpe := TJSONtype.jtString;
end; end;
fEvent(fEdName.Text, tpe); if (tpe in [jtObject, jtString]) and (fEdName.Text = '') then
Close; dlgOkError('This property requires a name')
else
begin
fEvent(fEdName.Text, tpe);
Close;
end;
end; end;
end; end;
{$ENDREGION} {$ENDREGION}