fixed IE7 issue where serialisation of Window does not match expected behaviour - new null check added.