Skip to content

Commit aff327d

Browse files
committed
Fixed an issue where there are no available catalogs. There was an IndexOutOfBoundsException, which is a no-no.
git-svn-id: https://olap4j.svn.sourceforge.net/svnroot/olap4j/trunk@238 c6a108a4-781c-0410-a6c6-c2d559e19af0
1 parent 2511d96 commit aff327d

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/org/olap4j/driver/xmla/XmlaOlap4jConnection.java

+7-1
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,13 @@ public String getCatalog() throws OlapException {
386386
if (this.catalogName == null) {
387387
// This means that no particular catalog name
388388
// was specified by the user.
389-
this.catalogName = this.getCatalogs().get(0).getName();
389+
List<Catalog> catalogs = this.getCatalogs();
390+
if (catalogs.size() == 0) {
391+
throw new OlapException("There is no catalog " +
392+
"available to query against.");
393+
} else {
394+
this.catalogName = catalogs.get(0).getName();
395+
}
390396
} else {
391397
// We must verify that the requested catalog name
392398
// exists in the metadata.

0 commit comments

Comments
 (0)