Merge pull request #111 from mbax/cleanup

Fix potential NPE, remove uneeded imports, static access for static vars.
This commit is contained in:
H31IX committed 2012-07-17 19:09:09 -07:00
commit 0ab77ed243
2 files changed
+9 -11

No files matched your search

@@ -19,16 +19,12 @@
package net.h31ix.anticheat; package net.h31ix.anticheat;
import java.io.*; import java.io.*;
import java.net.MalformedURLException;
import java.net.URL; import java.net.URL;
import java.net.URLClassLoader;
import java.net.URLConnection; import java.net.URLConnection;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Iterator; import java.util.Iterator;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.jar.JarEntry;
import java.util.jar.JarInputStream;
import java.util.logging.Level; import java.util.logging.Level;
import java.util.logging.Logger; import java.util.logging.Logger;
import net.h31ix.anticheat.event.*; import net.h31ix.anticheat.event.*;
@@ -387,10 +383,10 @@ public class Anticheat extends JavaPlugin
} }
private void cleanup() private void cleanup()
{ {
this.eventList = null; eventList = null;
this.manager = null; manager = null;
this.config = null; config = null;
this.metrics = null; metrics = null;
this.logger = null; logger = null;
} }
} }
@@ -69,11 +69,13 @@ public class PlayerManager
} }
else else
{ {
final String name = player.getName();
// Why, Why, Whyyyyy! // Why, Why, Whyyyyy!
if (player == null) if (player == null)
return false; return false;
final String name = player.getName();
if (level.get(name) == null || level.get(name) == 0) if (level.get(name) == null || level.get(name) == 0)
{ {