Skip to content

Commit

Permalink
Synchronize changes from 1.6 master branch [ci skip]
Browse files Browse the repository at this point in the history
6680737 Linux/arm crash fix (segmentation fault): added a check to verify itemList validity (empty) (#3301)
  • Loading branch information
github-actions[bot] committed Jan 30, 2024
2 parents 86da721 + 6680737 commit e858f20
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions Shared/sdk/CFastList.h
Expand Up @@ -307,6 +307,8 @@ class CFastList
template <class T, class U>
bool ListContains(const CFastList<T*>& itemList, const U& item)
{
if (itemList.empty())
return false;
return itemList.contains(item);
}

Expand Down
3 changes: 2 additions & 1 deletion Shared/sdk/SharedUtil.Misc.h
Expand Up @@ -344,13 +344,14 @@ namespace SharedUtil
template <class TL, class T>
bool ListContains(const TL& itemList, const T& item)
{
if (itemList.empty())
return false;
typename TL ::const_iterator it = itemList.begin();
for (; it != itemList.end(); ++it)
if (item == *it)
return true;
return false;
}

// Add item if it does not aleady exist in itemList
template <class TL, class T>
void ListAddUnique(TL& itemList, const T& item)
Expand Down

0 comments on commit e858f20

Please sign in to comment.