Skip to content

Commit 0697851

Browse files
committed
test(Speech to Text): Avoid index out of bounds exception in WebSocket test with long files
1 parent 7590045 commit 0697851

File tree

1 file changed

+1
-2
lines changed
  • speech-to-text/src/test/java/com/ibm/watson/developer_cloud/speech_to_text/v1

1 file changed

+1
-2
lines changed

speech-to-text/src/test/java/com/ibm/watson/developer_cloud/speech_to_text/v1/SpeechToTextIT.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -305,8 +305,7 @@ public void onError(Exception e) {
305305

306306
@Override
307307
public void onTranscription(SpeechRecognitionResults speechResults) {
308-
Long resultIndex = speechResults.getResultIndex();
309-
if (speechResults != null && speechResults.getResults().get(resultIndex.intValue()).isFinalResults()) {
308+
if (speechResults != null && speechResults.getResults().get(0).isFinalResults()) {
310309
asyncResults = speechResults;
311310
}
312311
}

0 commit comments

Comments
 (0)