- if (child_info->pid)
- caption = g_strdup_printf
- (_("--- Running: %s\n"),
- child_info->cmd);
- else
- caption = g_strdup_printf
- (_("--- Ended: %s\n"),
- child_info->cmd);
-
- gtk_text_insert(GTK_TEXT(text), NULL, NULL, NULL,
- caption, -1);
- gtk_text_insert(GTK_TEXT(text), NULL, NULL, NULL,
- child_info->output->str, -1);
- g_free(caption);
- child_info->new_out = FALSE;
+ if (child_info) {
+ if (child_info->pid)
+ caption = g_strdup_printf
+ (_("--- Running: %s\n"),
+ child_info->cmd);
+ else
+ caption = g_strdup_printf
+ (_("--- Ended: %s\n"),
+ child_info->cmd);
+
+ gtk_text_insert(GTK_TEXT(text), NULL, NULL, NULL,
+ caption, -1);
+ gtk_text_insert(GTK_TEXT(text), NULL, NULL, NULL,
+ child_info->output->str, -1);
+ g_free(caption);
+ child_info->new_out = FALSE;
+ }