diff --git a/mhcflurry/class1_neural_network.py b/mhcflurry/class1_neural_network.py
index 22d1637cf385331d2a46b4850f3649b2b7a1ab6e..dd367a334ed505d9dd97dbfcc17c8fc5ea7e9f2d 100644
--- a/mhcflurry/class1_neural_network.py
+++ b/mhcflurry/class1_neural_network.py
@@ -796,7 +796,7 @@ class Class1NeuralNetwork(object):
                 self.hyperparameters["random_negative_method"])
 
         random_negative_allele_encoding = None
-        if random_negative_alleles:
+        if random_negative_alleles is not None:
             random_negative_allele_encoding = AlleleEncoding(
                 random_negative_alleles, borrow_from=allele_encoding)