I wonder, what the cause could be that CFURLCreateWithString returns NULL. Has anybody experienced this behaviour?
Below code add additional checks.
bool juce_launchFile (const String& fileName,
const String& parameters)
{
if (fileName.startsWithIgnoreCase (T("http:")))
{
bool ok = false;
CFStringRef urlString = PlatformUtilities::juceStringToCFString (fileName);
if(urlString)
{
CFURLRef url = CFURLCreateWithString (kCFAllocatorDefault, urlString, 0);
CFRelease (urlString);
if(url)
{
ok = (LSOpenCFURLRef (url, 0) == noErr);
CFRelease (url);
}
}
return ok;
}
...