Don't segfault on "layout number" when not on a layout (thanks Soliton)
authorMicah Cowan <Micah Cowan micah@cowan.name>
Fri, 27 Feb 2009 04:17:33 +0000 (26 20:17 -0800)
committerMicah Cowan <Micah Cowan micah@cowan.name>
Fri, 27 Feb 2009 04:17:33 +0000 (26 20:17 -0800)
src/process.c

index 71c69e1..b5474e7 100644 (file)
@@ -4162,6 +4162,11 @@ int key;
        {
          int old;
          struct layout *lay;
+         if (!D_layout)
+           {
+             Msg(0, "not on a layout");
+             break;
+           }
          if (!args[1])
            {
              Msg(0, "This is layout %d (%s).\n", D_layout->lay_number, D_layout->lay_title);