Call to a member function firstWhere()

All of a sudden i encoutered this issue:
Call to a member function firstWhere() on null {“exception”:"[object] (Symfony\Component\Debug\Exception\FatalThrowableError(code: 0): Call to a member function firstWhere() on null at /home/librenms/LibreNMS/OS/Timos.php:674)"}

Device hasnt been polled for over an hour. I have several more devices of exact same type and everything is fine with them.
Does anybody know what reason for this could be?

I had to run rediscover to make it work again which is totally fine. If things like this happen, where you get a warning about devices not being polled, would this be recommended action or is it better to wait it out? I mean will system solve this on its own eventually?

This issue keeps coming back. Right now i have two devices that haven’t been polled for over 3 days. It’s usually cleared after next discovery but not this time. I have plenty of devices of same type and they are working fine.

this time it is different line in code. Maybe code changed over time.
Call to a member function firstWhere() on null {"exception":"[object] (Error(code: 0): Call to a member function firstWhere() on null at /home/librenms/LibreNMS/OS/Timos.php:804)"}

After some investigation i think the problem is that this function cannot handle null/empty value returned from poller.
Issue is with Nokia devices and MPLS LSP polling. Device in question doesnt have any LSP defined and returns null which causes function to fail.

public function pollMplsTunnelCHops($paths)

    {

        $mplsTunnelCHopCache = snmpwalk_cache_multi_oid($this->getDeviceArray(), 'vRtrMplsTunnelCHopTable', [], 'TIMETRA-MPLS-MIB', 'nokia', '-OQUsb');

        $chops = collect();

        foreach ($mplsTunnelCHopCache as $key => $value) {

            [$mplsTunnelCHopListIndex, $mplsTunnelCHopIndex] = explode('.', $key);

            FAILS >>> $lsp_path_id = $paths->firstWhere('mplsLspPathTunnelCHopListIndex', $mplsTunnelCHopListIndex)->lsp_path_id;

            $chops->push(new MplsTunnelCHop([

                'mplsTunnelCHopListIndex' => $mplsTunnelCHopListIndex,

                'mplsTunnelCHopIndex' => $mplsTunnelCHopIndex,

                'lsp_path_id' => $lsp_path_id,

                'device_id' => $this->getDeviceId(),

                'mplsTunnelCHopAddrType' => $value['vRtrMplsTunnelCHopAddrType'],

                'mplsTunnelCHopIpv4Addr' => $value['vRtrMplsTunnelCHopIpv4Addr'],

                'mplsTunnelCHopIpv6Addr' => $value['vRtrMplsTunnelCHopIpv6Addr'],

                'mplsTunnelCHopAsNumber' => $value['vRtrMplsTunnelCHopAsNumber'],

                'mplsTunnelCHopStrictOrLoose' => $value['vRtrMplsTunnelCHopStrictOrLoose'],

                'mplsTunnelCHopRouterId' => $value['vRtrMplsTunnelCHopRtrID'],

            ]));

        }

        return $chops;

    }