From dcf8452b15d75a91ccfc4987ab1c7f03b68a3e9a Mon Sep 17 00:00:00 2001 From: mattias Date: Wed, 27 May 2009 13:59:22 +0000 Subject: [PATCH] IDE: fixed crash on copying components with new methods, bug #13204 git-svn-id: trunk@20266 - --- designer/jitforms.pp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/designer/jitforms.pp b/designer/jitforms.pp index 7e274753fe..0020c409c3 100644 --- a/designer/jitforms.pp +++ b/designer/jitforms.pp @@ -1701,11 +1701,15 @@ begin // search in JIT method of stream class (e.g. ancestor) JITMethod:=JITMethods.Find(FCurReadStreamClass,TheMethodName); end; - if JITMethod=nil then begin + if (JITMethod=nil) and (Reader.LookupRoot<>nil) then begin // create a fake TJITMethod + //DebugLn(['TJITComponentList.ReaderSetMethodProperty ',DbgSName(reader.LookupRoot),' TheMethodName=',TheMethodName]); JITMethod:=JITMethods.Add(Reader.LookupRoot.ClassType,TheMethodName); end; - Method:=JITMethod.Method; + if JITMethod<>nil then + Method:=JITMethod.Method + else + Method.Data:=nil; end; SetMethodProp(Instance, PropInfo, Method);