From f2525d7b07018b3e55e02676b48c0421cabbe2ab Mon Sep 17 00:00:00 2001 From: Eric Coissac Date: Wed, 4 Dec 2024 11:42:05 +0100 Subject: [PATCH] Changes to be committed: modified: pkg/obilua/lua.go modified: pkg/obioptions/version.go --- pkg/obilua/lua.go | 11 +++++++++-- pkg/obioptions/version.go | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/pkg/obilua/lua.go b/pkg/obilua/lua.go index 08a71cf..20ff121 100644 --- a/pkg/obilua/lua.go +++ b/pkg/obilua/lua.go @@ -4,6 +4,7 @@ import ( "bytes" "fmt" "os" + "reflect" "git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obiiter" "git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obioptions" @@ -119,11 +120,17 @@ func LuaWorker(proto *lua.FunctionProto) obiseq.SeqWorker { case *obiseq.BioSequenceSlice: return *val, err default: - return nil, fmt.Errorf("worker function doesn't return the correct type %T", val) + r := reflect.TypeOf(val) + return nil, fmt.Errorf("worker function doesn't return the correct type %s", r) } } - return nil, fmt.Errorf("worker function doesn't return the correct type") + // If worker retuns nothing then it is considered as nil biosequence + if _, ok = lreponse.(*lua.LNilType); ok { + return nil, nil + } + + return nil, fmt.Errorf("worker function doesn't return the correct type %T", lreponse) } return f diff --git a/pkg/obioptions/version.go b/pkg/obioptions/version.go index 86414e1..0a6956c 100644 --- a/pkg/obioptions/version.go +++ b/pkg/obioptions/version.go @@ -7,7 +7,7 @@ import ( // TODO: The version number is extracted from git. This induces that the version // corresponds to the last commit, and not the one when the file will be // commited -var _Commit = "ad2461a" +var _Commit = "39dd3e3" var _Version = "Release 4.3.0" // Version returns the version of the obitools package.