Finding broken references

So… your approach made sense, but does not work quite right. Here’s why: When using the .include on the single ref, the call will return the .include object if the single ref is valid. If the single ref is broken (not valid), then the .include only returns the string value of the invalid single ref. Javascript barfs, because strings are not objects.

So to figure out if there is broken reference, I used the .typeof method on the single ref field to determine if it is an object or a string. If it is a string, then the reference is broken. Simple, but not obvious.

Now if I can figure out multi refs…