From 8ea966b3358d1e67d8c492572b48aed6c245e45f Mon Sep 17 00:00:00 2001
From: srosse <none@none>
Date: Wed, 10 Feb 2016 09:05:53 +0100
Subject: [PATCH] OO-1893: check the boundaries of the list of columns to
 prevent exception

---
 src/main/java/org/olat/core/gui/components/table/Table.java | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/main/java/org/olat/core/gui/components/table/Table.java b/src/main/java/org/olat/core/gui/components/table/Table.java
index c4884ca3740..f0e96ea9b9a 100644
--- a/src/main/java/org/olat/core/gui/components/table/Table.java
+++ b/src/main/java/org/olat/core/gui/components/table/Table.java
@@ -186,7 +186,10 @@ public class Table extends AbstractComponent {
 	 * @return Column descriptor of currently sorted column
 	 */
 	protected ColumnDescriptor getCurrentlySortedColumnDescriptor() {
-		return getColumnDescriptor(sortColumn);
+		if(columnOrder.size() >= 0 && sortColumn < columnOrder.size()) {
+			return getColumnDescriptor(sortColumn);
+		}
+		return null;
 	}
 
 	/**
-- 
GitLab