seqeralabs/tower-cli

java.lang.NullPointerException when querying resources-requested

Closed this issue · 1 comments

I'm trying to retrieve various stats with the Tower client, all works well until I try to retrieve resources-requested:
tw runs view -i 1YiHgTPIIB5ZGR task -t 1 --resources-requested

I get the following error:
Resources requested java.lang.NullPointerException at io.seqera.tower.cli.utils.FormatHelper.formatDurationMillis(FormatHelper.java:36) at io.seqera.tower.cli.responses.runs.tasks.TaskView.toString(TaskView.java:120) at io.seqera.tower.cli.utils.ResponseHelper.outputFormat(ResponseHelper.java:47) at io.seqera.tower.cli.commands.AbstractApiCmd.call(AbstractApiCmd.java:402) at io.seqera.tower.cli.commands.AbstractApiCmd.call(AbstractApiCmd.java:58) at picocli.CommandLine.executeUserObject(CommandLine.java:1953) at picocli.CommandLine.access$1300(CommandLine.java:145) at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2358) at picocli.CommandLine$RunLast.handle(CommandLine.java:2352) at picocli.CommandLine$RunLast.handle(CommandLine.java:2314) at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2179) at picocli.CommandLine$RunLast.execute(CommandLine.java:2316) at picocli.CommandLine.execute(CommandLine.java:2078) at io.seqera.tower.cli.Tower.main(Tower.java:91)

I suspect it might be due to some of the fields being null. See attached picture

Screenshot 2023-08-16 at 16 40 59

Hi @rulixxx
I managed to reproduce the error, there was a missing null guard in the code.

PR #324 fixes the issue.