Skip to content

Commit 1943c7a

Browse files
committed
Prevent catastrophic boot failure in wings when a server egg has bad data; closes pterodactyl#3055
1 parent 1927964 commit 1943c7a

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

app/Services/Eggs/EggConfigurationService.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,16 @@ protected function replacePlaceholders(Server $server, object $configs)
9898
// Normalize the output of the configuration for the new Wings Daemon to more
9999
// easily ingest, as well as make things more flexible down the road.
100100
foreach ($configs as $file => $data) {
101+
// Try to head off any errors relating to parsing a set of configuration files
102+
// or other JSON data for the egg. This should probably be blocked at the time
103+
// of egg creation/update, but it isn't so this check will at least prevent a
104+
// 500 error which would crash the entire Wings boot process.
105+
//
106+
// @see https://github.com/pterodactyl/panel/issues/3055
107+
if (!is_object($data) || !isset($data->find)) {
108+
continue;
109+
}
110+
101111
$append = array_merge((array) $data, ['file' => $file, 'replace' => []]);
102112

103113
foreach ($this->iterate($data->find, $structure) as $find => $replace) {

0 commit comments

Comments
 (0)