Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -104,14 +104,14 @@ public Answer execute(final SetupCommand command, final CitrixResourceBase citri
for (final PIF pif : hostPifs) {
final PIF.Record rec = pif.getRecord(conn);
if (rec.management) {
if (rec.VLAN != null && rec.VLAN != -1) {
if (host.getAPIVersionMajor(conn) < 8 && rec.VLAN != null && rec.VLAN != -1) {

Copilot AI Jul 23, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The API version check should include proper null safety. Consider checking if host.getAPIVersionMajor(conn) returns a valid value before comparison to prevent potential NullPointerException.

Suggested change
if (host.getAPIVersionMajor(conn) < 8 && rec.VLAN != null && rec.VLAN != -1) {
Integer apiVersionMajor = host.getAPIVersionMajor(conn);
if (apiVersionMajor == null) {
final String msg = "Unable to determine API version for host: " + citrixResourceBase.getHost().getUuid();
logger.warn(msg);
return new SetupAnswer(command, msg);
}
if (apiVersionMajor < 8 && rec.VLAN != null && rec.VLAN != -1) {

Copilot uses AI. Check for mistakes.
final String msg =
new StringBuilder("Unsupported configuration. Management network is on a VLAN. host=").append(citrixResourceBase.getHost().getUuid())
.append("; pif=")
.append(rec.uuid)
.append("; vlan=")
.append(rec.VLAN)
.toString();
.append("; pif=")
.append(rec.uuid)
.append("; vlan=")
.append(rec.VLAN)
.toString();
logger.warn(msg);
return new SetupAnswer(command, msg);
}
Expand Down
Loading