Browse Source

Fixed error when fetching files if resource has no name

Using the resource's ID instead in such a case
Andreas Fetzer 9 years ago
parent
commit
a34b091fae
1 changed files with 4 additions and 1 deletions
  1. 4 1
      Libs/XNAT/Core/ctkXnatResource.cpp

+ 4 - 1
Libs/XNAT/Core/ctkXnatResource.cpp

@@ -55,7 +55,10 @@ ctkXnatResource::~ctkXnatResource()
 //----------------------------------------------------------------------------
 QString ctkXnatResource::resourceUri() const
 {
-  return QString("%1/%2").arg(parent()->resourceUri(), this->name());
+  if (this->name().length() == 0 || this->name() == "NO NAME")
+    return QString("%1/%2").arg(parent()->resourceUri(), this->id());
+  else
+    return QString("%1/%2").arg(parent()->resourceUri(), this->name());
 }
 
 //----------------------------------------------------------------------------