openfga / sdk-generator

OpenFGA Client SDK Generator
Apache License 2.0
16 stars 38 forks source link

Java SDK - IndexOutOfBounds exception thrown when #313

Closed jimmyjames closed 7 months ago

jimmyjames commented 7 months ago

In OpenFgaClient#writeTransaction(String storeId, ClientWriteRequest request, ClientWriteOptions writeOptions), if the write transactions and delete transactions are null, an IndexOutOfBounds exception is thrown when trying to get the response, because we call get(0):

var futureResponse = this.writeNonTransaction(storeId, transactions.get(0), options);

This issue was discovered in #307.

We should not fail with an IndexOutOfBounds exception in this case.

jimmyjames commented 7 months ago

Fixed with #307