It looks like you are not taking into account that some articles don’t have a next or previous (first and last one). So, sorted_articles[prv] and sorted_articles[nxt] will be nil in those cases.
Denis
> --
> You received this message because you are subscribed to the nanoc discusssion group.
>
> To post to this group, send email to na...@googlegroups.com
> To unsubscribe from this group, send email to
> nanoc+un...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/nanoc?hl=en