From f47d97c54a4fbddcb915f4ac0c9b7e50f237c942 Mon Sep 17 00:00:00 2001 From: juanf <juanf> Date: Wed, 28 Oct 2015 11:36:13 +0000 Subject: [PATCH] SSDM-2551 : Null Pointer SVN: 34936 --- .../as/webapps/eln-lims/html/js/util/PrintUtil.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/plasmid/source/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/util/PrintUtil.js b/plasmid/source/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/util/PrintUtil.js index 85c7903731c..350bdf7e0dd 100644 --- a/plasmid/source/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/util/PrintUtil.js +++ b/plasmid/source/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/util/PrintUtil.js @@ -96,12 +96,14 @@ var PrintUtil = new function() { propertyContent = FormUtil.getVocabularyLabelForTermCode(propertyType, entity.properties[propertyCode]); } else if(propertyType.dataType === "MATERIAL") { var materialValue = entity.properties[propertyCode]; - var materialType = this._getMaterialTypeFromPropertyValue(materialValue); - if(materialType === "GENE" && entity.cachedMaterials) { //Specially supported materials from openBIS - var gene = this._getMaterialFromCode(entity.cachedMaterials, this._getMaterialCodeFromPropertyValue(materialValue)); - propertyContent = $("<span>").append(gene.properties["GENE_SYMBOLS"]); - } else { - propertyContent = $("<span>").append(materialValue); + if(materialValue) { + var materialType = this._getMaterialTypeFromPropertyValue(materialValue); + if(materialType === "GENE" && entity.cachedMaterials) { //Specially supported materials from openBIS + var gene = this._getMaterialFromCode(entity.cachedMaterials, this._getMaterialCodeFromPropertyValue(materialValue)); + propertyContent = $("<span>").append(gene.properties["GENE_SYMBOLS"]); + } else { + propertyContent = $("<span>").append(materialValue); + } } } else { propertyContent = entity.properties[propertyCode]; -- GitLab