Prevent self-assignment in assignment operator

This commit is contained in:
Chocobo1
2021-09-09 21:36:47 +08:00
parent c598bdd290
commit 298d63d47c
2 changed files with 8 additions and 2 deletions

View File

@@ -442,7 +442,10 @@ bool AutoDownloadRule::accepts(const QVariantHash &articleData)
AutoDownloadRule &AutoDownloadRule::operator=(const AutoDownloadRule &other)
{
m_dataPtr = other.m_dataPtr;
if (this != &other)
{
m_dataPtr = other.m_dataPtr;
}
return *this;
}