Hardened logic in case of broken containers. FABRIC-1186

Any reason why you added this to $scope & not just a normal JS var?