LCL: fixed OpenURL if URL is invalid, bug #24958

git-svn-id: trunk@42640 -
This commit is contained in:
mattias 2013-09-06 14:26:06 +00:00
parent 00b45080ca
commit eef666aa0d

View File

@ -8,13 +8,11 @@ var
begin
if AURL = '' then
Exit(False);
cf := CFStringCreateWithCString(kCFAllocatorDefault, @AURL[1], kCFStringEncodingUTF8);
if not Assigned(cf) then
url := CFURLCreateWithBytes(nil, @AURL[1], Length(AURL), kCFStringEncodingUTF8, nil);
if not Assigned(url) then
Exit(False);
url := CFURLCreateWithString(nil, cf, nil);
Result := LSOpenCFURLRef(url, nil) = 0;
CFRelease(url);
CFRelease(cf);
end;
// Open a document with the default application associated with it in the system