Skip to content

Commit

Permalink
RNGP - Do not attempt to substring to 1024 while logging. (#47509)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #47509

Fixes #47504

Changelog:
[Android] [Fixed] - RNGP - Do not attempt to substring to 1024 while logging

Reviewed By: javache

Differential Revision: D65659586

fbshipit-source-id: 8fa16131cea96b8b6aa9c0224c7b990a4f51175f
  • Loading branch information
cortinico authored and facebook-github-bot committed Nov 8, 2024
1 parent 3c32da5 commit e64513b
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import java.math.BigInteger
import java.security.MessageDigest
import java.util.concurrent.TimeUnit
import javax.inject.Inject
import kotlin.math.min
import org.gradle.api.GradleException
import org.gradle.api.file.FileCollection
import org.gradle.api.initialization.Settings
Expand Down Expand Up @@ -159,7 +160,10 @@ abstract class ReactSettingsExtension @Inject constructor(val settings: Settings
val logger = Logging.getLogger("ReactSettingsExtension")
logger.error(message)
if (cacheJsonConfig.length() != 0L) {
logger.error(cacheJsonConfig.readText().substring(0, 1024))
logger.error(
cacheJsonConfig
.readText()
.substring(0, min(1024, cacheJsonConfig.length().toInt())))
}
cacheJsonConfig.delete()
throw GradleException(message)
Expand Down

0 comments on commit e64513b

Please sign in to comment.