changeset 36:dfb159a079ea

merge
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 30 Aug 2012 12:37:48 +0200
parents f6d12037f886 (current diff) de56f3951fad (diff)
children 88f537ca35a5
files PalantirExplorer/explorer.js
diffstat 1 files changed, 12 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/PalantirExplorer/explorer.js	Thu Aug 30 12:24:31 2012 +0200
+++ b/PalantirExplorer/explorer.js	Thu Aug 30 12:37:48 2012 +0200
@@ -88,11 +88,23 @@
 
 function SortOnDicomTag(arr, tag, isInteger, reverse)
 {
+  var defaultValue;
+  if (isInteger)
+    defaultValue = 0;
+  else
+    defaultValue = '';
+
   arr.sort(function(a, b) {
     var ta = a.MainDicomTags[tag];
     var tb = b.MainDicomTags[tag];
     var order;
 
+    if (ta == undefined)
+      ta = defaultValue;
+
+    if (tb == undefined)
+      tb = defaultValue;
+
     if (isInteger)
     {
       ta = parseInt(ta, 10);