Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kotlin CLI sample crashes when space is typed #765

Open
rjrjr opened this issue Dec 11, 2019 · 0 comments
Open

Kotlin CLI sample crashes when space is typed #765

rjrjr opened this issue Dec 11, 2019 · 0 comments
Labels
bug Something isn't working kotlin

Comments

@rjrjr
Copy link
Contributor

rjrjr commented Dec 11, 2019

In Android Studio, right-click on Main.kt and choose Run.
Press the spacebar
Kaboom:

Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: 13
	at java.lang.String.substring(String.java:1963)
	at com.squareup.sample.hellotodo.EditTextWorkflowKt.insertCharAt(EditTextWorkflow.kt:99)
	at com.squareup.sample.hellotodo.EditTextWorkflowKt.access$insertCharAt(EditTextWorkflow.kt:1)
	at com.squareup.sample.hellotodo.EditTextWorkflow$onKeystroke$1.invoke(EditTextWorkflow.kt:71)
	at com.squareup.sample.hellotodo.EditTextWorkflow$onKeystroke$1.invoke(EditTextWorkflow.kt:16)
	at com.squareup.workflow.StatefulWorkflowKt$action$2.apply(StatefulWorkflow.kt:265)
	at com.squareup.workflow.WorkflowActionKt.applyTo(WorkflowAction.kt:182)
	at com.squareup.workflow.internal.WorkflowNode$tick$1.invoke(WorkflowNode.kt:174)
	at com.squareup.workflow.internal.WorkflowNode$tick$$inlined$forEach$lambda$1.invokeSuspend(WorkflowNode.kt:196)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlinx.coroutines.DispatchedTask.run(Dispatched.kt:241)
	at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:270)
	at kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:79)
	at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(Builders.kt:54)
	at kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source)
	at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking$default(Builders.kt:36)
	at kotlinx.coroutines.BuildersKt.runBlocking$default(Unknown Source)
	at com.squareup.sample.helloterminal.terminalworkflow.TerminalWorkflowRunner.run(TerminalWorkflowRunner.kt:72)
	at com.squareup.sample.hellotodo.MainKt.main(Main.kt:23)
	at com.squareup.sample.hellotodo.MainKt.main(Main.kt)
@rjrjr rjrjr changed the title CLI sample crashes when space is typed Kotlin CLI sample crashes when space is typed Dec 11, 2019
@zach-klippenstein zach-klippenstein added the bug Something isn't working label Dec 12, 2019
@rjrjr rjrjr transferred this issue from square/workflow May 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working kotlin
Projects
None yet
Development

No branches or pull requests

3 participants