I recommend using the main DB package functions, instead of the individual node versions. It's safer for error handling, as well as a long term plan to migrate to DB package and deprecate the databasenode versions.
local nodeChar = DB.getParent(DB.getParent(window.getDatabaseNode() ));
or
local nodeChar = DB.getChild(window.getDatabaseNode(), "...");
Regards,
JPG