From cc6fffdcad90782636e12559a3fdacae7e51c8db Mon Sep 17 00:00:00 2001
From: "D.Miwa" <suconbu@gmail.com>
Date: Tue, 23 Apr 2024 01:30:40 +0900
Subject: [PATCH] =?UTF-8?q?=E6=9C=80=E7=B5=82=E8=A1=8C=E3=82=92=E7=9F=A9?=
 =?UTF-8?q?=E5=BD=A2=E9=81=B8=E6=8A=9E=E3=81=97=E3=81=A6=E5=89=8A=E9=99=A4?=
 =?UTF-8?q?=E3=81=99=E3=82=8B=E3=81=A8=E8=90=BD=E3=81=A1=E3=82=8B=E5=95=8F?=
 =?UTF-8?q?=E9=A1=8C=E3=82=92=E4=BF=AE=E6=AD=A3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 sakura_core/view/CEditView_Command_New.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sakura_core/view/CEditView_Command_New.cpp b/sakura_core/view/CEditView_Command_New.cpp
index 64c30b3cc7..c9e12b4bfa 100644
--- a/sakura_core/view/CEditView_Command_New.cpp
+++ b/sakura_core/view/CEditView_Command_New.cpp
@@ -557,7 +557,7 @@ void CEditView::DeleteData(
 			
 			CLayoutPoint caretOld = CLayoutPoint(rcSel.left, rcSel.top);
 			m_pcEditDoc->m_cLayoutMgr.GetLineStr( rcSel.top, &nLineLen, &pcLayout );
-			if( rcSel.left <= pcLayout->CalcLayoutWidth( m_pcEditDoc->m_cLayoutMgr ) ){
+			if( pcLayout != NULL && rcSel.left <= pcLayout->CalcLayoutWidth( m_pcEditDoc->m_cLayoutMgr ) ){
 				// EOLより左なら文字の単位にそろえる
 				CLogicInt nIdxCaret = LineColumnToIndex( pcLayout, rcSel.left );
 				caretOld.SetX( LineIndexToColumn( pcLayout, nIdxCaret ) );