]> git.proxmox.com Git - qemu.git/blobdiff - console.c
Add checkpatch.pl from Linux kernel
[qemu.git] / console.c
index 698bc10a60c124846f09e9e30a2de4bf7b8bee54..c1728b1e04056e3a4ab4a9cc61f97ed918c865b9 100644 (file)
--- a/console.c
+++ b/console.c
@@ -1060,8 +1060,10 @@ void console_select(unsigned int index)
 
     if (index >= MAX_CONSOLES)
         return;
-    active_console->g_width = ds_get_width(active_console->ds);
-    active_console->g_height = ds_get_height(active_console->ds);
+    if (active_console) {
+        active_console->g_width = ds_get_width(active_console->ds);
+        active_console->g_height = ds_get_height(active_console->ds);
+    }
     s = consoles[index];
     if (s) {
         DisplayState *ds = s->ds;