Explorar o código

Throw an exception if plugin does not exist.

Sascha Zelzer %!s(int64=14) %!d(string=hai) anos
pai
achega
c81f30ae97
Modificáronse 1 ficheiros con 5 adicións e 0 borrados
  1. 5 0
      Libs/PluginFramework/ctkPluginDatabase.cpp

+ 5 - 0
Libs/PluginFramework/ctkPluginDatabase.cpp

@@ -269,6 +269,11 @@ ctkPluginArchive* ctkPluginDatabase::insertPlugin(const QUrl& location, const QS
 
   // Assemble the data for the sql record
   QFileInfo fileInfo(localPath);
+  if (!fileInfo.exists())
+  {
+    throw std::invalid_argument((localPath + " does not exist").toStdString());
+  }
+
   const QString lastModified = fileInfo.lastModified().toString(Qt::ISODate);
 
   QString resourcePrefix = fileInfo.baseName();