Skip to content

Commit 530d05e

Browse files
author
Otavio Santana
committed
Fixes elasticsearch drive
1 parent db5a227 commit 530d05e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

elasticsearch-driver/src/main/java/org/jnosql/diana/elasticsearch/document/ElasticsearchDocumentCollectionManagerFactory.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,10 @@ private void initDatabase(String database) {
7878
boolean exists = isExists(database);
7979
if (!exists) {
8080
URL url = ElasticsearchDocumentCollectionManagerFactory.class.getResource('/' + database + ".json");
81-
byte[] bytes = getBytes(url);
82-
client.admin().indices().prepareCreate(database).setSource(bytes).get();
81+
if (Objects.nonNull(url)) {
82+
byte[] bytes = getBytes(url);
83+
client.admin().indices().prepareCreate(database).setSource(bytes).get();
84+
}
8385
}
8486
}
8587

0 commit comments

Comments
 (0)