소스 검색

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();