PluginLoader#load: Fix NPE when no plugins used on a site
This fixes a NPE that was introduced in I19e564891, when no plugins are used on gerrit site. As the direct consequence of this error, inline edit feature is broken, because host page load sequence is interrupted and edit preferences cannot be loaded and thus inline editor cannot be initialized. Bug: Issue 5953 Bug: Issue 5929 Change-Id: I84b07aeb0283cc10d2dffa9ca04769b53f8e8b01
This commit is contained in:

committed by
David Pursehouse

parent
a38b35c21b
commit
721ac978a9
@@ -38,11 +38,8 @@ public class PluginLoader extends DialogBox {
|
||||
List<String> plugins, int loadTimeout, AsyncCallback<VoidResult> callback) {
|
||||
if (plugins == null || plugins.isEmpty()) {
|
||||
callback.onSuccess(VoidResult.create());
|
||||
}
|
||||
plugins = plugins.stream().filter(p -> p.endsWith(".js")).collect(Collectors.toList());
|
||||
if (plugins.isEmpty()) {
|
||||
callback.onSuccess(VoidResult.create());
|
||||
} else {
|
||||
plugins = plugins.stream().filter(p -> p.endsWith(".js")).collect(Collectors.toList());
|
||||
self = new PluginLoader(loadTimeout, callback);
|
||||
self.load(plugins);
|
||||
self.startTimers();
|
||||
|
Reference in New Issue
Block a user