Throws an exception if the candidate has no isXtype function.

candidates without xtype should be ignored.

fix:
Code:
 if (!candidate.destroyed && candidate.isXType && candidate.isXType(xtype, shallow)) {
                        result.push(candidate)
}