avoid nullpointer in pillarservlet

This commit is contained in:
Peter Hormanns 2024-01-25 19:39:35 +01:00
parent 22a99e98a3
commit 694b13bb55
2 changed files with 16 additions and 4 deletions

View File

@ -152,16 +152,16 @@ public class JsonPillarServlet extends HttpServlet {
} }
writer.println(" }"); writer.println(" }");
writer.println(" , \"validsubdomains\": \"" + validSubdomainNames + "\""); writer.println(" , \"validsubdomains\": \"" + validSubdomainNames + "\"");
if (passengerPython.length() > 0) { if (passengerPython != null && passengerPython.length() > 0) {
writer.println(" , \"passengerpython\": \"" + passengerPython + "\""); writer.println(" , \"passengerpython\": \"" + passengerPython + "\"");
} }
if (passengerNodejs.length() > 0) { if (passengerNodejs != null && passengerNodejs.length() > 0) {
writer.println(" , \"passengernodejs\": \"" + passengerNodejs + "\""); writer.println(" , \"passengernodejs\": \"" + passengerNodejs + "\"");
} }
if (passengerRuby.length() > 0) { if (passengerRuby != null && passengerRuby.length() > 0) {
writer.println(" , \"passengerruby\": \"" + passengerRuby + "\""); writer.println(" , \"passengerruby\": \"" + passengerRuby + "\"");
} }
if (fcgiPhpBin.length() > 0) { if (fcgiPhpBin != null && fcgiPhpBin.length() > 0) {
writer.println(" , \"fcgiphpbin\": \"" + fcgiPhpBin + "\""); writer.println(" , \"fcgiphpbin\": \"" + fcgiPhpBin + "\"");
} }
writer.println(" }"); writer.println(" }");

View File

@ -208,6 +208,9 @@ public class Domain extends AbstractEntity {
} }
public String getPassengerpython() { public String getPassengerpython() {
if (passengerpython == null) {
return "/usr/bin/python3";
}
return passengerpython; return passengerpython;
} }
@ -216,6 +219,9 @@ public class Domain extends AbstractEntity {
} }
public String getPassengernodejs() { public String getPassengernodejs() {
if (passengernodejs == null) {
return "/usr/bin/node";
}
return passengernodejs; return passengernodejs;
} }
@ -224,6 +230,9 @@ public class Domain extends AbstractEntity {
} }
public String getPassengerruby() { public String getPassengerruby() {
if (passengerruby == null) {
return "/usr/bin/ruby";
}
return passengerruby; return passengerruby;
} }
@ -232,6 +241,9 @@ public class Domain extends AbstractEntity {
} }
public String getFcgiphpbin() { public String getFcgiphpbin() {
if (fcgiphpbin == null) {
return "/usr/lib/cgi-bin/php";
}
return fcgiphpbin; return fcgiphpbin;
} }