🐛 Fix filename comparison
[xudocci.git] / src / main / java / net / pterodactylus / xdcc / core / Core.java
index 8ef074c..c9c0218 100644 (file)
@@ -39,6 +39,7 @@ import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 import java.util.Map.Entry;
+import java.util.Objects;
 import java.util.Set;
 import java.util.TreeMap;
 import java.util.concurrent.TimeUnit;
@@ -907,7 +908,7 @@ public class Core extends AbstractExecutionThreadService {
                eventBus.post(new GenericMessage("c"));
 
                /* check if it’s already downloading. */
-               if (downloads.values().stream().anyMatch(download -> download.filename().equals(dccSendReceived.filename()) && download.dccReceiver() != null)) {
+               if (downloads.values().stream().anyMatch(download -> Objects.equals(download.filename(), dccSendReceived.filename()) && download.dccReceiver() != null)) {
                        eventBus.post(new GenericMessage(format("Ignoring offer for %s, it’s already being downloaded.", dccSendReceived.filename())));
                        return;
                }