Skip to content

Commit

Permalink
Fixed an issue where there are no available catalogs. There was an In…
Browse files Browse the repository at this point in the history
…dexOutOfBoundsException, which is a no-no.

git-svn-id: https://olap4j.svn.sourceforge.net/svnroot/olap4j/trunk@238 c6a108a4-781c-0410-a6c6-c2d559e19af0
  • Loading branch information
lucboudreau committed May 13, 2009
1 parent 2511d96 commit aff327d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/org/olap4j/driver/xmla/XmlaOlap4jConnection.java
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,13 @@ public String getCatalog() throws OlapException {
if (this.catalogName == null) {
// This means that no particular catalog name
// was specified by the user.
this.catalogName = this.getCatalogs().get(0).getName();
List<Catalog> catalogs = this.getCatalogs();
if (catalogs.size() == 0) {
throw new OlapException("There is no catalog " +
"available to query against.");
} else {
this.catalogName = catalogs.get(0).getName();
}
} else {
// We must verify that the requested catalog name
// exists in the metadata.
Expand Down

0 comments on commit aff327d

Please sign in to comment.