Skip to content

Commit

Permalink
getPlugin checks whether the passed Bundle is not null
Browse files Browse the repository at this point in the history
Change-Id: I37431eee31bd667b484c557131adfd33e04829a6
  • Loading branch information
LorenzoBettini committed Dec 8, 2016
1 parent 065f79f commit e508cce
Showing 1 changed file with 5 additions and 1 deletion.
Expand Up @@ -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<String, String> headers = bundle.getHeaders();
String activator = headers.get(Constants.BUNDLE_ACTIVATOR);
Class<?> activatorClass;
Expand Down

0 comments on commit e508cce

Please sign in to comment.