I am getting this error...
code snippet that is throwing this error:
catalog.desc.text.textStyle(context.captionStyle).make(),
I am getting this error...
code snippet that is throwing this error:
catalog.desc.text.textStyle(context.captionStyle).make(),
Copyright © 2021 Jogjafile Inc.
Your object
context.captionStyle
has theTextStyle?
type, which means it can benull
. The.textStyle()
function only acceptsTextStyle
objects, hence the error.You either have to make sure that
context.captionStyle
is notnull
before trying to pass it to.textStyle()
, or assuring the compiler it will never benull
by writing.textStyle(context.captionStyle!)
(but you will still get an error if it becomesnull
somehow).