mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-03-25 15:38:11 -04:00
Display warning when an invalid icon index is requested.
This commit is contained in:
parent
537ffafefd
commit
89e778d324
@ -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)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user