mirror of
https://github.com/nextcloud/nextcloudpi.git
synced 2026-01-10 15:12:01 -03:30
elements.php: Fail gracefully if script configs can't be loaded
Signed-off-by: Tobias K <6317548+thecalcaholic@users.noreply.github.com>
This commit is contained in:
parent
0827781a5a
commit
bab86f2687
@ -182,6 +182,13 @@ function print_sidebar( $l /* translations l10n object */, $ticks /* wether to c
|
|||||||
$cfg_file = $cfg_dir . $ncp_app . ".cfg";
|
$cfg_file = $cfg_dir . $ncp_app . ".cfg";
|
||||||
$cfg = json_decode(file_get_contents($cfg_file), true);
|
$cfg = json_decode(file_get_contents($cfg_file), true);
|
||||||
|
|
||||||
|
try {
|
||||||
|
sizeof($cfg['params']);
|
||||||
|
} catch (TypeError $e) {
|
||||||
|
error_log("Failed loading script '$script'!, Config file '$cfg_file' could not be found or failed to be parsed.\n");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
$active = "";
|
$active = "";
|
||||||
if ( $ticks ) {
|
if ( $ticks ) {
|
||||||
exec("bash -c \"source /usr/local/etc/library.sh && is_active_app $ncp_app\"", $output, $retval);
|
exec("bash -c \"source /usr/local/etc/library.sh && is_active_app $ncp_app\"", $output, $retval);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user