diff --git a/photon-lib/py/photonlibpy/photonPipelineResult.py b/photon-lib/py/photonlibpy/photonPipelineResult.py index fb045546fa..340985d5c2 100644 --- a/photon-lib/py/photonlibpy/photonPipelineResult.py +++ b/photon-lib/py/photonlibpy/photonPipelineResult.py @@ -39,5 +39,10 @@ def getTimestamp(self) -> float: def getTargets(self) -> list[PhotonTrackedTarget]: return self.targets + def getBestTarget(self) -> PhotonTrackedTarget: + if not self.hasTargets(): + return None + return self.getTargets()[0] + def hasTargets(self) -> bool: return len(self.targets) > 0