Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
In function GetJAR, check if the Plugin's PluginLoader is the 
JavaPluginLoader class. If it isn't, return null. 
  • Loading branch information
roblabla committed Aug 18, 2012
1 parent 39da3e3 commit 77dd58b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/me/neatmonster/spacebukkit/plugins/PluginsManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ public class PluginsManager {
* @return Jar File the plugin's code is contained in
*/
public static File getJAR(final Plugin plugin) {
if (!plugin.getPluginLoader().getClass().equals(JavaPluginLoader.class)){
return null;
}
Class<?> currentClass = plugin.getClass();
while (!(currentClass.equals(JavaPlugin.class))) {
currentClass = currentClass.getSuperclass();
Expand Down

2 comments on commit 77dd58b

@tips48
Copy link

@tips48 tips48 commented on 77dd58b Aug 19, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you tested this?

@roblabla
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. See XereoNet#194

Please sign in to comment.