To keep compatibility with existing menu classes, why not wrap in a try clause, assuming the code that follows can cope with more nodes than necessary when truncate is set?