mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-08-16 02:01:27 -04:00
Display warning when an invalid icon index is requested.
This commit is contained in:
parent
537ffafefd
commit
89e778d324
1 changed files with 3 additions and 2 deletions
|
@ -22,7 +22,8 @@ DatabaseIcons* DatabaseIcons::m_instance(0);
|
||||||
|
|
||||||
QIcon DatabaseIcons::icon(int index)
|
QIcon DatabaseIcons::icon(int index)
|
||||||
{
|
{
|
||||||
if (index >= iconCount()) {
|
if (index < 0 || index >= iconCount()) {
|
||||||
|
qWarning("DatabaseIcons::icon: invalid icon index %d", index);
|
||||||
return QIcon();
|
return QIcon();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -112,7 +113,7 @@ DatabaseIcons::DatabaseIcons()
|
||||||
|
|
||||||
Q_ASSERT(m_indexToName.size() == iconCount());
|
Q_ASSERT(m_indexToName.size() == iconCount());
|
||||||
}
|
}
|
||||||
#include <QFile>
|
|
||||||
QIcon DatabaseIcons::getIconInternal(int index)
|
QIcon DatabaseIcons::getIconInternal(int index)
|
||||||
{
|
{
|
||||||
if (m_iconCache.contains(index)) {
|
if (m_iconCache.contains(index)) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue