aboutsummaryrefslogtreecommitdiffhomepage
path: root/vendor/github.com/hashicorp/terraform/dag/marshal.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/hashicorp/terraform/dag/marshal.go')
-rw-r--r--vendor/github.com/hashicorp/terraform/dag/marshal.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/vendor/github.com/hashicorp/terraform/dag/marshal.go b/vendor/github.com/hashicorp/terraform/dag/marshal.go
index 16d5dd6..c567d27 100644
--- a/vendor/github.com/hashicorp/terraform/dag/marshal.go
+++ b/vendor/github.com/hashicorp/terraform/dag/marshal.go
@@ -273,6 +273,9 @@ func (e *encoder) Encode(i interface{}) {
273} 273}
274 274
275func (e *encoder) Add(v Vertex) { 275func (e *encoder) Add(v Vertex) {
276 if e == nil {
277 return
278 }
276 e.Encode(marshalTransform{ 279 e.Encode(marshalTransform{
277 Type: typeTransform, 280 Type: typeTransform,
278 AddVertex: newMarshalVertex(v), 281 AddVertex: newMarshalVertex(v),
@@ -281,6 +284,9 @@ func (e *encoder) Add(v Vertex) {
281 284
282// Remove records the removal of Vertex v. 285// Remove records the removal of Vertex v.
283func (e *encoder) Remove(v Vertex) { 286func (e *encoder) Remove(v Vertex) {
287 if e == nil {
288 return
289 }
284 e.Encode(marshalTransform{ 290 e.Encode(marshalTransform{
285 Type: typeTransform, 291 Type: typeTransform,
286 RemoveVertex: newMarshalVertex(v), 292 RemoveVertex: newMarshalVertex(v),
@@ -288,6 +294,9 @@ func (e *encoder) Remove(v Vertex) {
288} 294}
289 295
290func (e *encoder) Connect(edge Edge) { 296func (e *encoder) Connect(edge Edge) {
297 if e == nil {
298 return
299 }
291 e.Encode(marshalTransform{ 300 e.Encode(marshalTransform{
292 Type: typeTransform, 301 Type: typeTransform,
293 AddEdge: newMarshalEdge(edge), 302 AddEdge: newMarshalEdge(edge),
@@ -295,6 +304,9 @@ func (e *encoder) Connect(edge Edge) {
295} 304}
296 305
297func (e *encoder) RemoveEdge(edge Edge) { 306func (e *encoder) RemoveEdge(edge Edge) {
307 if e == nil {
308 return
309 }
298 e.Encode(marshalTransform{ 310 e.Encode(marshalTransform{
299 Type: typeTransform, 311 Type: typeTransform,
300 RemoveEdge: newMarshalEdge(edge), 312 RemoveEdge: newMarshalEdge(edge),