diff --git a/tui/tui.go b/tui/tui.go index 93e494db8..a1eef8565 100644 --- a/tui/tui.go +++ b/tui/tui.go @@ -315,6 +315,10 @@ func (ui *UI) fileItemSelected(row, column int) { func (ui *UI) deviceItemSelected(row, column int) { selectedDevice := ui.table.GetCell(row, column).GetReference().(*analyze.Device) + if ui.ignoreDirPaths == nil { + ui.ignoreDirPaths = make(map[string]bool, 10) + } + for _, device := range ui.devices { if device.Name != selectedDevice.Name && !strings.HasPrefix(selectedDevice.MountPoint, device.MountPoint) { ui.ignoreDirPaths[device.MountPoint] = true diff --git a/tui/tui_test.go b/tui/tui_test.go index db53bef43..2d8a63f8d 100644 --- a/tui/tui_test.go +++ b/tui/tui_test.go @@ -319,7 +319,6 @@ func TestSelectDevice(t *testing.T) { simScreen.SetSize(50, 50) ui := CreateUI(simScreen, true) - ui.SetIgnoreDirPaths([]string{"/"}) ui.analyzer = analyzeMock ui.ListDevices(getDevicesInfoMock)