Bug 1084513 - Add a null check on callingDoc before we try and get its principal. r=smaug