We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2511d96 commit aff327dCopy full SHA for aff327d
src/org/olap4j/driver/xmla/XmlaOlap4jConnection.java
@@ -386,7 +386,13 @@ public String getCatalog() throws OlapException {
386
if (this.catalogName == null) {
387
// This means that no particular catalog name
388
// was specified by the user.
389
- this.catalogName = this.getCatalogs().get(0).getName();
+ 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
+ }
396
} else {
397
// We must verify that the requested catalog name
398
// exists in the metadata.
0 commit comments