blob: 09cb944b0ae8c1df58bf2580a318b003222e284d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
From: Kevin Funk <kfunk@kde.org>
Date: Tue, 18 Oct 2016 07:47:28 +0000
Subject: GitHub: Don't crash when Git plugin not loaded
X-Git-Url: http://quickgit.kde.org/?p=kdevelop.git&a=commitdiff&h=3afcc322a94878c8f5f662c1c5795b75a3bf62a5
---
GitHub: Don't crash when Git plugin not loaded
BUG: 331883
FIXED-IN: 5.0.3
---
--- a/providers/ghprovider/ghproviderwidget.cpp
+++ b/providers/ghprovider/ghproviderwidget.cpp
@@ -91,17 +91,20 @@
if (!pos.isValid())
return nullptr;
+ auto plugin = ICore::self()->pluginController()->pluginForExtension("org.kdevelop.IBasicVersionControl", "kdevgit");
+ if (!plugin) {
+ KMessageBox::error(0, i18n("The Git plugin could not be loaded which is required to import a Github project."), i18n("Github Provider Error"));
+ return nullptr;
+ }
+
QString url = pos.data(ProviderModel::VcsLocationRole).toString();
if (m_account->validAccount())
url = "https://" + m_account->token() + "@" + url.mid(8);
QUrl real = QUrl(url);
VcsLocation loc(real);
- auto plugin = ICore::self()->pluginController()->pluginForExtension("org.kdevelop.IBasicVersionControl", "kdevgit");
- Q_ASSERT(plugin);
auto vc = plugin->extension<IBasicVersionControl>();
Q_ASSERT(vc);
-
return vc->createWorkingCopy(loc, dest);
}
|