From 9fa9401ccb8970af2e09df5ce428be3c0ef40467 Mon Sep 17 00:00:00 2001 From: David Huynh Date: Sun, 9 May 2010 19:35:42 +0000 Subject: [PATCH] Fixed a bug in which if the target of a protograph link was somehow missing, the project.html wouldn't load. git-svn-id: http://google-refine.googlecode.com/svn/trunk@665 7d457c2a-affb-35e4-300a-418c747d4874 --- src/main/java/com/metaweb/gridworks/protograph/Link.java | 5 ++++- .../webapp/scripts/protograph/schema-alignment-ui-link.js | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/metaweb/gridworks/protograph/Link.java b/src/main/java/com/metaweb/gridworks/protograph/Link.java index b162c998f..d67d2cc46 100644 --- a/src/main/java/com/metaweb/gridworks/protograph/Link.java +++ b/src/main/java/com/metaweb/gridworks/protograph/Link.java @@ -29,7 +29,10 @@ public class Link implements Jsonizable { writer.object(); writer.key("property"); property.write(writer, options); - writer.key("target"); target.write(writer, options); + if (target != null) { + writer.key("target"); + target.write(writer, options); + } writer.endObject(); } diff --git a/src/main/webapp/scripts/protograph/schema-alignment-ui-link.js b/src/main/webapp/scripts/protograph/schema-alignment-ui-link.js index 06e2831dd..a09a4e7ff 100644 --- a/src/main/webapp/scripts/protograph/schema-alignment-ui-link.js +++ b/src/main/webapp/scripts/protograph/schema-alignment-ui-link.js @@ -4,6 +4,9 @@ SchemaAlignmentDialog.UILink = function(dialog, link, table, options, parentUINo this._options = options; this._parentUINode = parentUINode; + // Make sure target node is there + this._link.target = this._link.target || { nodeType: "cell-as-value" } + this._tr = table.insertRow(table.rows.length); this._tdMain = this._tr.insertCell(0); this._tdToggle = this._tr.insertCell(1);