Revision: 13439
http://jvcl.svn.sourceforge.net/jvcl/?rev=13439&view=rev
Author: ahuser
Date: 2012-09-24 12:24:22 +0000 (Mon, 24 Sep 2012)
Log Message:
-----------
Mantis #5986: Dropping a TJvAppCommand on a data module raises an access violation
Modified Paths:
--------------
trunk/jvcl/run/JvAppCommand.pas
Modified: trunk/jvcl/run/JvAppCommand.pas
===================================================================
--- trunk/jvcl/run/JvAppCommand.pas 2012-09-24 11:54:30 UTC (rev 13438)
+++ trunk/jvcl/run/JvAppCommand.pas 2012-09-24 12:24:22 UTC (rev 13439)
@@ -149,7 +149,7 @@
implementation
uses
- JvWndProcHook;
+ JvWndProcHook, JvResources;
const
// from JwaWinUser.pas
@@ -178,7 +178,11 @@
constructor TJvAppCommand.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
- FForm := GetParentForm(TControl(AOwner));
+ FForm := nil;
+ if AOwner is TControl then
+ FForm := GetParentForm(AOwner as TControl);
+ if FForm = nil then
+ raise Exception.CreateResFmt(@RsEOwnerMustBeForm, [ClassName]);
Active := True;
end;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|