Yah that's exactly what's wrong. I'm yet to figure it out...
This is mostly vBulletin's fault because in plugin hooks it uses seemingly random variables for things... The same template is used to show posts and also to show PMs. When you're viewing a post, there's a array, when you view a PM, there is still a array but it's not created by the time the hook is run... it's annoying and odd.
Edit: The issue is fixed. It was a bad IF statement in a template conditional.