mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2025-01-19 09:45:28 +01:00
Strip empty entry in update-alternatives output
Catch ValueError on missing end quote in java execution command
This commit is contained in:
parent
6fe5d16ded
commit
7379545186
@ -647,8 +647,9 @@ class PanelHandler(BaseHandler):
|
|||||||
if temp_version != current_java and version != "java":
|
if temp_version != current_java and version != "java":
|
||||||
page_java.append(version)
|
page_java.append(version)
|
||||||
else:
|
else:
|
||||||
if version != current_java:
|
if len(version) > 0:
|
||||||
page_java.append(version)
|
if version != current_java:
|
||||||
|
page_java.append(version)
|
||||||
|
|
||||||
page_data["java_versions"] = page_java
|
page_data["java_versions"] = page_java
|
||||||
|
|
||||||
@ -1387,8 +1388,15 @@ class PanelHandler(BaseHandler):
|
|||||||
server_id = self.check_server_id()
|
server_id = self.check_server_id()
|
||||||
if server_id is None:
|
if server_id is None:
|
||||||
return
|
return
|
||||||
execution_list = shlex.split(execution_command)
|
|
||||||
if java_selection:
|
if java_selection:
|
||||||
|
try:
|
||||||
|
execution_list = shlex.split(execution_command)
|
||||||
|
except ValueError:
|
||||||
|
self.redirect(
|
||||||
|
"/panel/error?error=Invalid execution command. Java path"
|
||||||
|
" must be surrounded by quotes."
|
||||||
|
" (Are you missing a closing quote?)"
|
||||||
|
)
|
||||||
if not any(
|
if not any(
|
||||||
java_selection in path for path in Helpers.find_java_installs()
|
java_selection in path for path in Helpers.find_java_installs()
|
||||||
):
|
):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user