You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by lo...@apache.org on 2020/10/23 19:10:08 UTC

[beam] branch master updated: Fix nil pointer exception in `graphx.Marshal` (#13178)

This is an automated email from the ASF dual-hosted git repository.

lostluck pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/beam.git


The following commit(s) were added to refs/heads/master by this push:
     new 707456b  Fix nil pointer exception in `graphx.Marshal` (#13178)
707456b is described below

commit 707456bdabb7957c2ffc60fd8038c1d39e802d3b
Author: Simone Primarosa <si...@outlook.com>
AuthorDate: Fri Oct 23 20:09:43 2020 +0100

    Fix nil pointer exception in `graphx.Marshal` (#13178)
---
 sdks/go/pkg/beam/core/runtime/graphx/translate.go | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/sdks/go/pkg/beam/core/runtime/graphx/translate.go b/sdks/go/pkg/beam/core/runtime/graphx/translate.go
index 70d39a3..a52dd43 100644
--- a/sdks/go/pkg/beam/core/runtime/graphx/translate.go
+++ b/sdks/go/pkg/beam/core/runtime/graphx/translate.go
@@ -120,6 +120,10 @@ type Options struct {
 
 // Marshal converts a graph to a model pipeline.
 func Marshal(edges []*graph.MultiEdge, opt *Options) (*pipepb.Pipeline, error) {
+	if len(edges) == 0 {
+		return nil, errors.New("empty graph")
+	}
+	
 	tree := NewScopeTree(edges)
 
 	m := newMarshaller(opt)