Explorar o código

Fixed error when fetching files if resource has no name

Using the resource's ID instead in such a case
Andreas Fetzer %!s(int64=9) %!d(string=hai) anos
pai
achega
a34b091fae
Modificáronse 1 ficheiros con 4 adicións e 1 borrados
  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());
 }
 
 //----------------------------------------------------------------------------