virenerus/tabletoptool

NPE on createLink

Closed this issue · 1 comments

The usage of createLink to create a URI to a macroasset seems to only work if the macro is on a token.

For example:

def macroIWantLinked = campaign.getCampaignMacro("test")
macroIWantLinked.createLink("Click Me", "args if any")

The problem being the campaign macros don't have a token assignment so they return null

StringBuilder sb=new StringBuilder("<a href=\"macro://");
sb.append(macro.getToken().getId().toString())

Is this intended?

No it isn't. It's just an oversight-.-
should be easy enough to fix. We could simply create something like:
macro://campaign/macroname