浏览代码

Throw an exception if plugin does not exist.

Sascha Zelzer 14 年之前
父节点
当前提交
c81f30ae97
共有 1 个文件被更改,包括 5 次插入0 次删除
  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();