mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-12-04 15:39:34 +01:00
Display warning when an invalid icon index is requested.
This commit is contained in:
@@ -22,7 +22,8 @@ DatabaseIcons* DatabaseIcons::m_instance(0);
|
||||
|
||||
QIcon DatabaseIcons::icon(int index)
|
||||
{
|
||||
if (index >= iconCount()) {
|
||||
if (index < 0 || index >= iconCount()) {
|
||||
qWarning("DatabaseIcons::icon: invalid icon index %d", index);
|
||||
return QIcon();
|
||||
}
|
||||
|
||||
@@ -112,7 +113,7 @@ DatabaseIcons::DatabaseIcons()
|
||||
|
||||
Q_ASSERT(m_indexToName.size() == iconCount());
|
||||
}
|
||||
#include <QFile>
|
||||
|
||||
QIcon DatabaseIcons::getIconInternal(int index)
|
||||
{
|
||||
if (m_iconCache.contains(index)) {
|
||||
|
||||
Reference in New Issue
Block a user