fix: MoveScanner SelectedIndex 범위 가드 추가

그리드 빈 영역/헤더 더블클릭, Apply 전, Esc 선택해제 등으로 SelectedIndex가 -1이거나 VisionCorrectionList 범위를 벗어난 상태에서 MoveScanner가 호출되면 인덱스 예외가 발생했다. 진입부에서 범위를 검사해 무시하도록 처리.
This commit is contained in:
노도연 2026-07-28 17:09:41 +09:00
parent 3407bb7cae
commit b7257dfc7a

View File

@ -535,6 +535,9 @@ namespace WeldingCommon.Views
public void MoveScanner()
{
// 선택된 셀이 없거나(-1) 리스트 범위를 벗어난 인덱스면 무시 (그리드 빈영역/헤더 더블클릭, Apply 전, Esc 선택해제 등)
if (SelectedIndex < 0 || SelectedIndex >= VisionCorrectionList.Count) return;
double scannerPosX = VisionCorrectionList[SelectedIndex].MasterX;
double scannerPosY = VisionCorrectionList[SelectedIndex].MasterY;
var res = MessageUtil.ShowYesNoMessageDialog("Scanner", $"Move Scanner to Postion(X : {scannerPosX}, Y: {scannerPosY}) of Selected Cell?");