summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2022-11-15 20:09:32 +0300
committerGeorge Hazan <ghazan@miranda.im>2022-11-15 20:09:32 +0300
commit1f52752c82ac31ca9a6f3dc5259bf2934b2fc3f6 (patch)
tree2de2d26d2d1809f1b2d5c805dcde5e66a8fb84a5 /plugins
parent72487fc9b2d8b99318941edc27c71c3be36a0872 (diff)
fixes #3239 (random crash in SmileyAdd)
Diffstat (limited to 'plugins')
-rw-r--r--plugins/SmileyAdd/src/smileys.cpp12
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)