Skip to content

Commit

Permalink
Fix bug that would crash UstadDetailField if imageId = 0.
Browse files Browse the repository at this point in the history
  • Loading branch information
mikedawson committed Jul 11, 2023
1 parent 5fee62e commit 3f17172
Showing 1 changed file with 13 additions and 7 deletions.
Expand Up @@ -74,13 +74,19 @@ fun UstadDetailField(
onClick = onClick,
secondaryActionContent = secondaryActionContent,
icon = {
Image(
painter = painterResource(id = imageId),
contentDescription = null,
colorFilter = ColorFilter.tint(
color = contentColorFor(backgroundColor = MaterialTheme.colors.background)),
modifier = Modifier
.size(24.dp))
if(imageId != 0) {
Image(
painter = painterResource(id = imageId),
contentDescription = null,
colorFilter = ColorFilter.tint(
color = contentColorFor(backgroundColor = MaterialTheme.colors.background)),
modifier = Modifier
.size(24.dp))
}else {
Spacer(
modifier = Modifier.size(24.dp)
)
}
}
)
}
Expand Down

0 comments on commit 3f17172

Please sign in to comment.