Issue CRM-14394. Check that $path is not NULL, and that the file exists.