Issue #1242362 by DamienMcKenna: Adding extra check in template.php that ensures that the ['rdf'] variable is an object.