Permalink
Browse files

CPODocument::LoadFile: do not log error if file does not exist

  • Loading branch information...
Karlson2k committed Jul 13, 2014
1 parent d7f5a7a commit c6a051a8dbf6c12e4950eaad7d2dab65521bb9f8
Showing with 6 additions and 1 deletion.
  1. +6 −1 xbmc/utils/POUtils.cpp
View
@@ -19,6 +19,7 @@
*/
#include "utils/POUtils.h"
+#include "URL.h"
#include "filesystem/File.h"
#include "utils/log.h"
#include <stdlib.h>
@@ -36,9 +37,13 @@ CPODocument::~CPODocument() {}
bool CPODocument::LoadFile(const std::string &pofilename)
{
+ CURL poFileUrl(pofilename);
+ if (!XFILE::CFile::Exists(poFileUrl))
+ return false;
+
XFILE::CFile file;
XFILE::auto_buffer buf;
- if (file.LoadFile(pofilename, buf) < 18) // at least a size of a minimalistic header
+ if (file.LoadFile(poFileUrl, buf) < 18) // at least a size of a minimalistic header
{
CLog::Log(LOGERROR, "%s: can't load file \"%s\" or file is too small", __FUNCTION__, pofilename.c_str());
return false;

0 comments on commit c6a051a

Please sign in to comment.