Checks that opengraph and fb data is defined before trying to loop through it. Fixes bug and tests should now pass.