From bdeea08a53c90e66417d466dea60f8346cfdcfe4 Mon Sep 17 00:00:00 2001 From: Bas Leijdekkers Date: Thu, 22 May 2014 13:17:38 +0200 Subject: [PATCH] fix java.lang.IllegalArgumentException: Row index out of range when history is empty --- .../intellij/openapi/vcs/history/FileHistoryPanelImpl.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/history/FileHistoryPanelImpl.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/history/FileHistoryPanelImpl.java index 12d71d694495..753f24d0f057 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/history/FileHistoryPanelImpl.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/history/FileHistoryPanelImpl.java @@ -410,7 +410,10 @@ public class FileHistoryPanelImpl extends PanelWithActionsAndCloseButton { treeView.scrollRectToVisible(treeView.getCellRect(lastRow, 0, true)); } } - myDualView.getFlatView().addRowSelectionInterval(0, 0); + final TableView flatView = myDualView.getFlatView(); + if (flatView.getRowCount() > 0) { + flatView.addRowSelectionInterval(0, 0); + } myInRefresh = false; myTargetSelection = null;