From c6d90475a1dc4fabd2be06768012fd48a32ecf46 Mon Sep 17 00:00:00 2001 From: Mitchell Foral Date: Thu, 15 Apr 2021 09:01:02 +1000 Subject: Avoid crash on Win32 as it doesn't support font options. --- gtk/ScintillaGTK.cxx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'gtk/ScintillaGTK.cxx') diff --git a/gtk/ScintillaGTK.cxx b/gtk/ScintillaGTK.cxx index 3acae3c0d..46655d785 100755 --- a/gtk/ScintillaGTK.cxx +++ b/gtk/ScintillaGTK.cxx @@ -181,10 +181,12 @@ FontOptions::FontOptions(GtkWidget *widget) noexcept { PLATFORM_ASSERT(pcontext); const cairo_font_options_t *options = pango_cairo_context_get_font_options(pcontext); // options is owned by the PangoContext so must not be freed. - PLATFORM_ASSERT(options); - antialias = cairo_font_options_get_antialias(options); - order = cairo_font_options_get_subpixel_order(options); - hint = cairo_font_options_get_hint_style(options); + if (options) { + // options is NULL on Win32 + antialias = cairo_font_options_get_antialias(options); + order = cairo_font_options_get_subpixel_order(options); + hint = cairo_font_options_get_hint_style(options); + } g_object_unref(pcontext); } -- cgit v1.2.3