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

Empty Column or Row causes exception in render #69

Closed
bnorm opened this issue Sep 2, 2022 · 1 comment · Fixed by #71
Closed

Empty Column or Row causes exception in render #69

bnorm opened this issue Sep 2, 2022 · 1 comment · Fixed by #71

Comments

@bnorm
Copy link
Contributor

bnorm commented Sep 2, 2022

Example which causes exception

runMosaic {
    setContent {
        Column {}
    }
}

Exception stack trace

Exception in thread "main" java.lang.IllegalArgumentException: Row start value out of range [0,0): 0
        at com.jakewharton.mosaic.TextCanvas.get(canvas.kt:22)
        at com.jakewharton.mosaic.BoxNode.renderTo(nodes.kt:136)
        at com.jakewharton.mosaic.MosaicNode.render(nodes.kt:26)
        at com.jakewharton.mosaic.MosaicKt$runMosaic$1$2.invokeSuspend(mosaic.kt:55)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
        at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
        at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:274)
        at kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:85)
        at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(Builders.kt:59)
        at kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source)
        at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking$default(Builders.kt:38)
        at kotlinx.coroutines.BuildersKt.runBlocking$default(Unknown Source)
        at com.jakewharton.mosaic.MosaicKt.runMosaic(mosaic.kt:28)

This is actually fixed in #66 here: https://github.com/JakeWharton/mosaic/pull/66/files#diff-edb81a24f298abe6e7ff34ccd8691345abc86bed07218a3d05d49793406d9f7fR21. I could move that change into a separate PR if you aren't ready for the whole Static design yet.

@JakeWharton
Copy link
Owner

A separate PR means I can slam the merge button without much thought.

The Static stuff, on the other hand, I absolutely need time to look at and as I'm just getting home from Droidcon NYC it will be no sooner than next week (we're off Monday & Tuesday).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants