diff --git a/core/src/main/java/com/orientechnologies/orient/core/sql/executor/CreateEdgesStep.java b/core/src/main/java/com/orientechnologies/orient/core/sql/executor/CreateEdgesStep.java index 42946a75c07..724d42245ac 100755 --- a/core/src/main/java/com/orientechnologies/orient/core/sql/executor/CreateEdgesStep.java +++ b/core/src/main/java/com/orientechnologies/orient/core/sql/executor/CreateEdgesStep.java @@ -152,17 +152,17 @@ private void init() { Iterator toIter = (Iterator) toValues; - while (toIter != null && toIter.hasNext()) { - toList.add(toIter.next()); - } - - toIterator = toList.iterator(); if (toIter instanceof OResultSet) { try { ((OResultSet) toIter).reset(); } catch (Exception ignore) { } } + while (toIter != null && toIter.hasNext()) { + toList.add(toIter.next()); + } + + toIterator = toList.iterator(); currentFrom = fromIter != null && fromIter.hasNext() ? asVertex(fromIter.next()) : null;