diff options
author | larrignon <95510378+larrignon@users.noreply.github.com> | 2022-12-08 02:08:48 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-08 11:08:48 +1000 |
commit | 7cc3d3cb9555848c59a325e6113b3de5ddb209ea (patch) | |
tree | 1e7a21dfcbe5118ed83affe8d593e1999eab6b01 | |
parent | 2959a0ab80aeb5628d8499aabc94cbd8f77e05e1 (diff) |
[VideoInfoScanner] Prevent logging errors by getting empty directory (#22173)
* Prevent logging errors by getting empty directory.
Prevent logging errors by getting empty directory.
-rw-r--r-- | xbmc/video/VideoInfoScanner.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/xbmc/video/VideoInfoScanner.cpp b/xbmc/video/VideoInfoScanner.cpp index 900d0b4253..e51a53dbd0 100644 --- a/xbmc/video/VideoInfoScanner.cpp +++ b/xbmc/video/VideoInfoScanner.cpp @@ -2099,8 +2099,12 @@ namespace VIDEO int maxSeasons = 0; CFileItemList items; std::string extensions = CServiceBroker::GetFileExtensionProvider().GetPictureExtensions(); - CDirectory::GetDirectory(show.m_strPath, items, extensions, - DIR_FLAG_NO_FILE_DIRS | DIR_FLAG_READ_CACHE | DIR_FLAG_NO_FILE_INFO); + if (!show.m_strPath.empty()) + { + CDirectory::GetDirectory(show.m_strPath, items, extensions, + DIR_FLAG_NO_FILE_DIRS | DIR_FLAG_READ_CACHE | + DIR_FLAG_NO_FILE_INFO); + } extensions.erase(std::remove(extensions.begin(), extensions.end(), '.'), extensions.end()); CRegExp reg; if (items.Size() && reg.RegComp("season([0-9]+)(-[a-z0-9]+)?\\.(" + extensions + ")")) |