Previously if a PTYForward instance had the window title set but no
background color set then it would crash in an assertion as
pty_forward_ansi_process didn't require both to be present.
systemd-vmspawn could get into this state if it failed to get the
terminal tint color.
Now any method that would have called background_color_sequence now
becomes just a NOP if the background color is not set.
This allows keeping the functionality to set window titles even if the
terminal doesn't support the background coloring.
_cleanup_free_ char *s = NULL;
assert(f);
- assert(f->background_color);
+
+ if (!f->background_color)
+ return 0;
/* When we see a newline (ASCII 10) then this sets the background color to the desired one, and erase the rest
* of the line with it */
_cleanup_free_ char *s = NULL;
assert(f);
- assert(f->background_color);
+
+ if (!f->background_color)
+ return 0;
/* When we see a carriage return (ASCII 13) this this sets only the background */