Hi, I think we could do something slightly different. More or less:

    if (testCase.getPlatform() == null) {
        (platform != null ? platform.getId() : null), // platform id
        (platform != null ? platform.getName() : null), // platform name
    } else {
        // platformId is set to null
        (testCase.getPlatform() != null ? testCase.getPlatform() : null), // platform name
    }

I think it would both fix 20589, and not break when the testCase.getPlatform() is null (JUnit or TestNG strategies) but the platform was set via the job config screen.

WDYT?