summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2021-12-19 08:50:15 +0100
committerManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2021-12-19 08:50:25 +0100
commit4d934e003a55be05416e2b137f73734664a47dce (patch)
tree5ac8415ba0df3c2c3bab500822a211ceb4ab58df /src
parent29531873ea4395a2dc65cefcc28db09569c38c18 (diff)
Add check against NULL pointer (fix for issue #338).
Diffstat (limited to 'src')
-rw-r--r--src/drivers/GDI/Fl_GDI_Graphics_Driver.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/drivers/GDI/Fl_GDI_Graphics_Driver.cxx b/src/drivers/GDI/Fl_GDI_Graphics_Driver.cxx
index cc947399e..484830e2a 100644
--- a/src/drivers/GDI/Fl_GDI_Graphics_Driver.cxx
+++ b/src/drivers/GDI/Fl_GDI_Graphics_Driver.cxx
@@ -275,7 +275,8 @@ void Fl_GDI_Graphics_Driver::set_spot(int font, int size, int X, int Y, int W, i
cfs.ptCurrentPos.y = int(Y * s) - int(tw->labelsize() * s);
// Attempt to have temporary text entered by input method use scaled font.
// Does good, but still not always effective.
- SelectObject((HDC)gc(), ((Fl_GDI_Font_Descriptor*)font_descriptor())->fid);
+ Fl_GDI_Font_Descriptor *desc = (Fl_GDI_Font_Descriptor*)font_descriptor();
+ if (desc) SelectObject((HDC)gc(), desc->fid);
MapWindowPoints(fl_xid(win), fl_xid(tw), &cfs.ptCurrentPos, 1);
flImmSetCompositionWindow(himc, &cfs);
flImmReleaseContext(fl_xid(tw), himc);