Skip to content

Commit 3a1c60d

Browse files
author
Joachim Marder
committed
Fixed possible exceptions that occurred whith no views defined. (Issue #53)
1 parent dcb182f commit 3a1c60d

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

Designer/FViews.pas

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1561,6 +1561,8 @@ procedure TFrameViews.Activate;
15611561
var
15621562
Command: TRibbonCommand;
15631563
begin
1564+
if TreeViewRibbon.Items.Count = 0 then
1565+
exit;// Nothing to do here
15641566
ActionDelete.ShortCut := ShortCut(VK_DELETE, [ssCtrl]);
15651567
ActionMoveUp.ShortCut := ShortCut(VK_UP, [ssCtrl]);
15661568
ActionMoveDown.ShortCut := ShortCut(VK_DOWN, [ssCtrl]);;

Designer/FXmlSource.pas

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ procedure TFrameXmlSource.Activate;
5555
TreeViewXmlSource.Items.BeginUpdate;
5656
try
5757
TreeViewXmlSource.Items.Clear;
58-
if FileExists(FDocument.Filename) then
58+
if Assigned(FDocument) and FileExists(FDocument.Filename) then
5959
begin
6060
FXmlDoc.LoadFromFile(FDocument.Filename);
6161
LineNum := 2;

0 commit comments

Comments
 (0)