Skip to content

Commit 2713cd3

Browse files
committed
fixup! feat: filter out root package
Make the code more robust with respect to handling abnormal conditions.
1 parent e00f2b8 commit 2713cd3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

agent/lib_composer.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ static void nr_execute_handle_autoload_composer_get_packages_information(
140140
" $packages = array();"
141141
" foreach (\\Composer\\InstalledVersions::getAllRawData() as $installed) { "
142142
" foreach ($installed['versions'] as $packageName => $packageData) {"
143-
" if ($packageName == @$root_package['name']) {"
143+
" if (is_array($root_package) && array_key_exists('name', $root_package) && $packageName == $root_package['name']) {"
144144
" continue;"
145145
" }"
146146
" if (isset($packageData['pretty_version'])) {"

0 commit comments

Comments
 (0)