Bug 1027792 - The linkAnimation and linkSelection methods in CanvasGraphUtils should first check if graphs are actually available, r=pbrosset

This commit is contained in:
Victor Porof 2014-06-20 05:47:56 -04:00
parent 3889ab5b5b
commit d4bdf0070f

View File

@ -1563,6 +1563,9 @@ this.CanvasGraphUtils = {
* Merges the animation loop of two graphs.
*/
linkAnimation: Task.async(function*(graph1, graph2) {
if (!graph1 || !graph2) {
return;
}
yield graph1.ready();
yield graph2.ready();
@ -1583,6 +1586,9 @@ this.CanvasGraphUtils = {
* Makes sure selections in one graph are reflected in another.
*/
linkSelection: function(graph1, graph2) {
if (!graph1 || !graph2) {
return;
}
graph1.on("selecting", () => {
graph2.setSelection(graph1.getSelection());
});