From 375dc80d93e67269c77225bd086248d54cc9c2bf Mon Sep 17 00:00:00 2001 From: Brian Duranleau Date: Thu, 18 Apr 2024 11:48:04 -0500 Subject: [PATCH] chore: check valid type on pkg key gen --- daemon/internal/newrelic/app.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/daemon/internal/newrelic/app.go b/daemon/internal/newrelic/app.go index 0a35b1a1c..5f39e553e 100644 --- a/daemon/internal/newrelic/app.go +++ b/daemon/internal/newrelic/app.go @@ -383,8 +383,10 @@ func (app *App) filterPhpPackages(data []byte) []byte { log.Errorf("invalid php package json structure: %+v", pkg) return nil } - pkgKey = PhpPackagesKey{pkg[0].(string), pkg[1].(string)} - _, ok := app.PhpPackages[pkgKey] + name, ok := pkg[0].(string) + version, ok := pkg[1].(string) + pkgKey = PhpPackagesKey{name, version} + _, ok = app.PhpPackages[pkgKey] if !ok { app.PhpPackages[pkgKey] = struct{}{} newPkgs = append(newPkgs, pkgKey)