Przeglądaj źródła

Fixed error when fetching files if resource has no name

Using the resource's ID instead in such a case
Andreas Fetzer 9 lat temu
rodzic
commit
a34b091fae
1 zmienionych plików z 4 dodań i 1 usunięć
  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());
 }
 
 //----------------------------------------------------------------------------