aboutsummaryrefslogtreecommitdiffstats
path: root/src/dispnew.c
diff options
context:
space:
mode:
authorRichard M. Stallman <[email protected]>2005-04-09 23:51:18 +0000
committerRichard M. Stallman <[email protected]>2005-04-09 23:51:18 +0000
commit6183d8422dc7e32df05454c13b6fa6c97cf5cbbb (patch)
tree3e6008b8065a1bb8581a464c8d42a37398a858e5 /src/dispnew.c
parent941f97789e0a5e28bf4e27e187dfca67352e11b2 (diff)
(mirror_line_dance): Avoid crash if W2 is null.
Diffstat (limited to 'src/dispnew.c')
-rw-r--r--src/dispnew.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/src/dispnew.c b/src/dispnew.c
index 5ffd1a2ce5..4f29abdb38 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -3165,14 +3165,20 @@ mirror_line_dance (w, unchanged_at_top, nlines, copy_from, retained_p)
int m2_from;
w2 = frame_row_to_window (root, frame_from);
- m2 = w2->current_matrix;
- m2_from = frame_from - m2->matrix_y;
- copy_row_except_pointers (m->rows + window_to,
- m2->rows + m2_from);
-
- /* If frame line is empty, window line is empty, too. */
- if (!retained_p[copy_from[i]])
- m->rows[window_to].enabled_p = 0;
+ /* [email protected]: when enabling menu bar using `emacs
+ -nw', FROM_FRAME sometimes has no associated window.
+ This check avoids a segfault if W2 is null. */
+ if (w2)
+ {
+ m2 = w2->current_matrix;
+ m2_from = frame_from - m2->matrix_y;
+ copy_row_except_pointers (m->rows + window_to,
+ m2->rows + m2_from);
+
+ /* If frame line is empty, window line is empty, too. */
+ if (!retained_p[copy_from[i]])
+ m->rows[window_to].enabled_p = 0;
+ }
sync_p = 1;
}
else if (from_inside_window_p)