reject nil resources

If the resource is generated by a method, that method may return nil to indicate no resource is needed. This patch makes that not pass the nil up to the CF template.