How to detect a nonexistent OID

Hi,

I’m not a programmer, so please forgiveness.

Can you advise me how to detect bad OID in LibreNMS/OS/filename.php?
I’m trying to make a condition that uses the next OID in case of a bad OID.

Thank you