Skip to content

Commit

Permalink
Merge pull request #547 from phantomjinx/master
Browse files Browse the repository at this point in the history
TEIIDDES-2803: NoSuchElementException when vdb is not in the workspace
  • Loading branch information
blafond committed Mar 7, 2016
2 parents 3b30ec7 + 024a0e7 commit 0914f67
Showing 1 changed file with 7 additions and 3 deletions.
Expand Up @@ -21,6 +21,7 @@
import java.util.Enumeration;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
Expand Down Expand Up @@ -682,9 +683,12 @@ public static MultiStatus validateVdbModelsInWorkspace(final IFile theVdbFile) {
if( resource == null ) {
// Find by name
Collection<IFile> resources = WorkspaceResourceFinderUtil.findIResourceInProjectByName(modelName, theProject);
IFile someResource = resources.iterator().next();
if( ! ModelUtil.isVdbArchiveFile(someResource)) {
resource = someResource;
Iterator<IFile> iterator = resources.iterator();
if (iterator.hasNext()) {
IFile someResource = iterator.next();
if( ! ModelUtil.isVdbArchiveFile(someResource)) {
resource = someResource;
}
}
}
}
Expand Down

0 comments on commit 0914f67

Please sign in to comment.