Make sure a page has a type before accessing page['type']
Merge pull request #13 from Tenzer/missing-type-check

Make sure a page has a type before accessing page['type']