diff --git a/src/main/java/org/gcube/portlets/user/td/gwtservice/server/opexecution/OpExecution4ChangeColumnsPosition.java b/src/main/java/org/gcube/portlets/user/td/gwtservice/server/opexecution/OpExecution4ChangeColumnsPosition.java index 153d984..ab82b78 100644 --- a/src/main/java/org/gcube/portlets/user/td/gwtservice/server/opexecution/OpExecution4ChangeColumnsPosition.java +++ b/src/main/java/org/gcube/portlets/user/td/gwtservice/server/opexecution/OpExecution4ChangeColumnsPosition.java @@ -69,7 +69,13 @@ public class OpExecution4ChangeColumnsPosition extends OpExecutionBuilder { logger.error("Error in change position: no column set"); throw new TDGWTServiceException("No column set"); } + + if (changeColumnsPositionSession.getColumns().size() <=1) { + logger.error("Error in change position: Columns <= 1"); + throw new TDGWTServiceException("There are not enough columns"); + } + ArrayList columns = new ArrayList(); for (ColumnData col : changeColumnsPositionSession.getColumns()) { ColumnLocalId columnId = new ColumnLocalId(col.getColumnId());