diff options
-rw-r--r-- | plugins/SmileyAdd/src/smileys.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/plugins/SmileyAdd/src/smileys.cpp b/plugins/SmileyAdd/src/smileys.cpp index cfc681e3dd..3c3dd69b33 100644 --- a/plugins/SmileyAdd/src/smileys.cpp +++ b/plugins/SmileyAdd/src/smileys.cpp @@ -131,11 +131,13 @@ HICON SmileyType::GetIcon(void) HICON SmileyType::GetIconDup(void) { - ImageBase *img = CreateCachedImage(); - img->SelectFrame(m_index); - HICON hIcon = img->GetIcon(); - img->Release(); - return hIcon; + if (ImageBase *img = CreateCachedImage()) { + img->SelectFrame(m_index); + HICON hIcon = img->GetIcon(); + img->Release(); + return hIcon; + } + return nullptr; } bool SmileyType::LoadFromImage(IStream *pStream) |