From 84532d55290c4ca4c8ddcb1de4f885af6a6a8ee7 Mon Sep 17 00:00:00 2001
From: Nathanael Jourdane <nathanael.jourdane@irap.omp.eu>
Date: Mon, 31 Jul 2017 16:36:51 +0200
Subject: [PATCH] Fix crash when load epn-tap module from amda tree (2/2)

---
 js/app/controllers/EpnTapModule.js | 3 ++-
 js/app/views/EpnTapUI.js           | 6 +++++-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/js/app/controllers/EpnTapModule.js b/js/app/controllers/EpnTapModule.js
index f8519f0..6978816 100644
--- a/js/app/controllers/EpnTapModule.js
+++ b/js/app/controllers/EpnTapModule.js
@@ -69,10 +69,11 @@ Ext.define('amdaDesktop.EpnTapModule', {
 	****************************/
 
 	/**
-	Trigerred after the a click on the "Display EPN-TAP service" item from the an AMDA tree contextual menu.
+	Trigerred after the a click on the "Display EPN-TAP service" item from the contextual menu in the tree view.
 	*/
 	createWindow: function (icon_id) {
 		this.callParent();
+
 		Ext.getCmp('epntap-win').setSize(800, 600);
 		var icons_dic = {
 			'icon-mercury': ['ts', 'planet', 'mercury'],
diff --git a/js/app/views/EpnTapUI.js b/js/app/views/EpnTapUI.js
index 70f8695..9be4138 100644
--- a/js/app/views/EpnTapUI.js
+++ b/js/app/views/EpnTapUI.js
@@ -734,7 +734,11 @@ Ext.define('amdaUI.EpnTapUI', {
 				createInfoPanel()
 			],
 			listeners: {
-				'beforerender': function(me) { Ext.getCmp('epntap-win').setPosition(100, 100);}
+				'beforerender': function(me) {
+					if(Ext.getCmp('epntap-win') != null) {
+						Ext.getCmp('epntap-win').setPosition(100, 100);
+					}
+				}
 			}
 
 		};
--
libgit2 0.21.2