How to check if an item exist | in a file-base automation with JavaScript Scripting (ECMAScript 2022+)

I have a dynamic code written in a file-based rule based on JavaScript Scripting (ECMAScript 2022+).
I only want to do the sendCommand on the item if it really exist?
How can it test this in the if clause?

if (items.getItem("HT_" + raum + "_Fensterzustand") !== null) {
                items.getItem("HT_" + raum + "_Fensterzustand").sendCommand("OPEN");
}

This doesn’t work and gives the following error:

org.openhab.core.items.ItemNotFoundException: Item 'HT_Testdiele_Fensterzustand' could not be found in the item registry

Thank you so much!

Maybe you set the optional second parameter to true?

(static) getItem(name, nullIfMissingopt) → {Item|null}

From items - Documentation

Whow that was a easy solution! Thanks a lot!