Tinkoff / investAPI

399 stars 136 forks source link

Краш в методе Currency::getMainTableEntry при поптытке получения позиций по счёту #118

Closed IamDmitriy closed 2 years ago

IamDmitriy commented 2 years ago

Падает, если в ответе присутствует евро (eur)

Exception in thread "DefaultDispatcher-worker-1" java.lang.IllegalArgumentException at java.base/java.util.Currency.getMainTableEntry(Currency.java:676) at java.base/java.util.Currency.getInstance(Currency.java:320) at java.base/java.util.Currency.getInstance(Currency.java:297) at ru.tinkoff.piapi.core.models.Money.fromResponse(Money.java:17) at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195) at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1625) at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484) at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474) at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913) at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:578) at ru.tinkoff.piapi.core.models.Positions.fromResponse(Positions.java:20) at ru.tinkoff.piapi.core.OperationsService.getPositionsSync(OperationsService.java:222) at com.easyapps.investApi.InvestRepositoryImpl.getPositionsExample(InvestRepositoryImpl.kt:294) at com.easyapps.investApi.InvestRepositoryImpl.access$getPositionsExample(InvestRepositoryImpl.kt:18) at com.easyapps.investApi.InvestRepositoryImpl$start$1.invokeSuspend(InvestRepositoryImpl.kt:33) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106) at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665)

hondasmx commented 2 years ago

Пришлите, пожалуйста, tracking_id

hondasmx commented 2 years ago

Проблему починили в 5 версии SDK https://github.com/Tinkoff/invest-api-java-sdk/pull/13