[gnome-builder/gnome-builder-41] markedview: fix warning for NULL literal
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder/gnome-builder-41] markedview: fix warning for NULL literal
- Date: Wed, 8 Dec 2021 00:40:42 +0000 (UTC)
commit e5b18b2f422f1f98172a062848257e754fd99dbc
Author: Christian Hergert <chergert redhat com>
Date: Tue Dec 7 16:40:18 2021 -0800
markedview: fix warning for NULL literal
src/libide/gui/ide-marked-view.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/src/libide/gui/ide-marked-view.c b/src/libide/gui/ide-marked-view.c
index 2dbdfc6bc..9fd77346a 100644
--- a/src/libide/gui/ide-marked-view.c
+++ b/src/libide/gui/ide-marked-view.c
@@ -118,9 +118,15 @@ render_node(GString *out,
case CMARK_NODE_EMPH:
if (entering)
{
- literal_escaped = g_markup_escape_text (cmark_node_get_literal (node), -1);
+ const char *literal = cmark_node_get_literal (node);
+
g_string_append (out, "<i>");
- g_string_append (out, literal_escaped);
+
+ if (literal)
+ {
+ literal_escaped = g_markup_escape_text (literal, -1);
+ g_string_append (out, literal_escaped);
+ }
}
if (!entering || node_is_leaf (node))
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]