summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--chardev/char.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/chardev/char.c b/chardev/char.c
index a1722aa076..1c7f6c711a 100644
--- a/chardev/char.c
+++ b/chardev/char.c
@@ -726,7 +726,7 @@ static Chardev *__qemu_chr_new(const char *label, const char *filename,
 
     if (strstart(filename, "chardev:", &p)) {
         chr = qemu_chr_find(p);
-        if (replay) {
+        if (replay && chr) {
             qemu_chardev_set_replay(chr, &err);
             if (err) {
                 error_report_err(err);