From e508cce3cbb3d4dea1c22dca92eb3b242c3d8c57 Mon Sep 17 00:00:00 2001 From: Lorenzo Bettini Date: Sun, 13 Nov 2016 17:02:15 +0100 Subject: [PATCH] getPlugin checks whether the passed Bundle is not null Change-Id: I37431eee31bd667b484c557131adfd33e04829a6 --- .../src/org/eclipse/emf/parsley/runtime/ui/PluginUtil.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugins/org.eclipse.emf.parsley.runtime.common/src/org/eclipse/emf/parsley/runtime/ui/PluginUtil.java b/plugins/org.eclipse.emf.parsley.runtime.common/src/org/eclipse/emf/parsley/runtime/ui/PluginUtil.java index 72bcf33cc..0d4ef29f6 100644 --- a/plugins/org.eclipse.emf.parsley.runtime.common/src/org/eclipse/emf/parsley/runtime/ui/PluginUtil.java +++ b/plugins/org.eclipse.emf.parsley.runtime.common/src/org/eclipse/emf/parsley/runtime/ui/PluginUtil.java @@ -39,13 +39,17 @@ public static Bundle getBundle(Class classFromBundle) { /** * Retrieves the {@link AbstractUIPlugin} activator from the specified {@link Bundle}, * via reflection, assuming that the activator has a static method getDefault returning - * the singleton instance. + * the singleton instance. If the specified {@link Bundle} is null, then it simply + * returns null. * * @param bundle * @return * @throws PluginConfigurationException if bundle is not found or if it doesn't contain the getDefault method */ public static AbstractUIPlugin getPlugin(Bundle bundle){ + if (bundle == null) { + return null; + } final Dictionary headers = bundle.getHeaders(); String activator = headers.get(Constants.BUNDLE_ACTIVATOR); Class activatorClass;