diff --git a/dlls/riched20/caret.c b/dlls/riched20/caret.c index 5f7d52aa4cf..c56e5961f73 100644 --- a/dlls/riched20/caret.c +++ b/dlls/riched20/caret.c @@ -774,12 +774,10 @@ ME_MoveCursorWords(ME_TextEditor *editor, ME_Cursor *cursor, int nRelOfs) { para = run->para; /* Skip empty start of table row paragraph */ - if (para_prev( para )->nFlags & MEPF_ROWSTART) + if (para_prev( para ) && para_prev( para )->nFlags & MEPF_ROWSTART) para = para_prev( para ); /* Paragraph breaks are treated as separate words */ - if (para_get_di( para_prev( para ) )->type == diTextStart) - return FALSE; - + if (!para_prev( para )) return FALSE; para = para_prev( para ); run = para_end_run( para ); } diff --git a/dlls/riched20/para.c b/dlls/riched20/para.c index 99ce1706631..431f89faed3 100644 --- a/dlls/riched20/para.c +++ b/dlls/riched20/para.c @@ -64,7 +64,7 @@ ME_Paragraph *para_next( ME_Paragraph *para ) ME_Paragraph *para_prev( ME_Paragraph *para ) { - if (para->prev_para) return ¶->prev_para->member.para; + if (para->prev_para && para->prev_para->type == diParagraph) return ¶->prev_para->member.para; return NULL; }