File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
src/main/kotlin/com/github/yusufugurozbek/testcontainers/port/updater/impl Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ class DataSourceUpdaterImpl(private var project: Project) : DataSourceUpdater {
35
35
private fun getLogMessage (logEntryText : String ): String {
36
36
if (settingsState.loggingFormat == LoggingFormat .JSON && logEntryText.contains(settingsState.logEntryPrefix)) {
37
37
try {
38
- return Json .parseToJsonElement(logEntryText).jsonObject[" message" ]!! .jsonPrimitive.content
38
+ return Json .parseToJsonElement(logEntryText).jsonObject[" message" ]? .jsonPrimitive? .content ? : " "
39
39
} catch (e: Exception ) {
40
40
thisLogger().warn(" JSON log message cannot be extracted" , e)
41
41
}
@@ -53,7 +53,7 @@ class DataSourceUpdaterImpl(private var project: Project) : DataSourceUpdater {
53
53
val isUpdatable = dataSourceUrl.matches(logEntryDataSourceUrl, settingsState.matchMode)
54
54
55
55
if (isUpdatable) {
56
- val newUrl = dataSourceUrl.toString().replace(dataSourceUrl. port, logEntryDataSourceUrl.port)
56
+ val newUrl = dataSourceUrl.copy( port = logEntryDataSourceUrl.port).toString( )
57
57
localDataSource.url = newUrl
58
58
if (settingsState.isNotificationsEnabled) {
59
59
TpuNotifier .notify(project, " Updated data source URL: $newUrl " )
You can’t perform that action at this time.
0 commit comments