Selaa lähdekoodia

Merge pull request #570 from csmith/master

Add defensive checkNotNull.
pull/571/head
Greg Holmes 9 vuotta sitten
vanhempi
commit
0ed2c3eeb0
1 muutettua tiedostoa jossa 3 lisäystä ja 1 poistoa
  1. 3
    1
      src/com/dmdirc/commandparser/parsers/ServerCommandParser.java

+ 3
- 1
src/com/dmdirc/commandparser/parsers/ServerCommandParser.java Näytä tiedosto

@@ -38,6 +38,8 @@ import com.dmdirc.interfaces.config.AggregateConfigProvider;
38 38
 
39 39
 import javax.annotation.Nonnull;
40 40
 
41
+import static com.google.common.base.Preconditions.checkNotNull;
42
+
41 43
 /**
42 44
  * A command parser used in the context of a server.
43 45
  */
@@ -64,7 +66,7 @@ public class ServerCommandParser extends GlobalCommandParser {
64 66
             final DMDircMBassador eventBus,
65 67
             final Connection connection) {
66 68
         super(configManager, commandController, eventBus);
67
-        this.server = connection;
69
+        this.server = checkNotNull(connection);
68 70
     }
69 71
 
70 72
     /** Loads the relevant commands into the parser. */

Loading…
Peruuta
Tallenna