aboutsummaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
Diffstat (limited to 'server')
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v107/MigrateSmtpConfigurationIT.java3
-rw-r--r--server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v107/MigrateSmtpConfiguration.java2
2 files changed, 3 insertions, 2 deletions
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v107/MigrateSmtpConfigurationIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v107/MigrateSmtpConfigurationIT.java
index f40b7a22fc7..efcd150bc41 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v107/MigrateSmtpConfigurationIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v107/MigrateSmtpConfigurationIT.java
@@ -165,6 +165,7 @@ class MigrateSmtpConfigurationIT {
return new Object[][]{
{"ssl", "SSLTLS"},
{"starttls", "STARTTLS"},
+ {null, "NONE"},
{"", "NONE"},
{"null", "NONE"},
{"random", "NONE"}
@@ -280,4 +281,4 @@ class MigrateSmtpConfigurationIT {
db.executeInsert("internal_properties", "kee", key, "is_empty", false, "text_value", value, "created_at", 0);
}
-} \ No newline at end of file
+}
diff --git a/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v107/MigrateSmtpConfiguration.java b/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v107/MigrateSmtpConfiguration.java
index 7eb56e75d9d..0ec5bbbba93 100644
--- a/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v107/MigrateSmtpConfiguration.java
+++ b/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v107/MigrateSmtpConfiguration.java
@@ -138,7 +138,7 @@ public class MigrateSmtpConfiguration extends DataChange {
}
private static PropertyDb getSecureConnectionWithNewValues(PropertyDb currentProperty) {
- String newValue = switch (currentProperty.value) {
+ String newValue = switch (currentProperty.value == null ? "" : currentProperty.value) {
case "ssl" -> "SSLTLS";
case "starttls" -> "STARTTLS";
default -> "NONE";