summaryrefslogtreecommitdiff
path: root/pango/serializer.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2022-09-26 20:24:25 -0400
committerMatthias Clasen <mclasen@redhat.com>2022-09-26 20:46:00 -0400
commitf47e506bb0f692a4e2c6e498f2433cf781acb4eb (patch)
treea7b31a4f0d115974c9e43c008508e8c4f6363892 /pango/serializer.c
parentb7666befa248ea0cb9716b8e3c3e6b43e9f15ccf (diff)
downloadpango-f47e506bb0f692a4e2c6e498f2433cf781acb4eb.tar.gz
serializer: Handle lack of fonts
Make the serializer only serialize the font of a layout if it is not NULL. This lets us survive no-fonts situations better.
Diffstat (limited to 'pango/serializer.c')
-rw-r--r--pango/serializer.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/pango/serializer.c b/pango/serializer.c
index 2dab93b4..e3a22800 100644
--- a/pango/serializer.c
+++ b/pango/serializer.c
@@ -653,7 +653,8 @@ add_run (GtkJsonPrinter *printer,
gtk_json_printer_add_string (printer, "language", pango_language_to_string (run->item->analysis.language));
gtk_json_printer_add_string (printer, "script", get_script_name (run->item->analysis.script));
- add_font (printer, "font", run->item->analysis.font);
+ if (run->item->analysis.font)
+ add_font (printer, "font", run->item->analysis.font);
gtk_json_printer_add_integer (printer, "flags", run->item->analysis.flags & ANALYSIS_FLAGS);