Prevent NullPointerExceptions on new Sones
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Tue, 21 Jul 2015 20:35:15 +0000 (22:35 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Tue, 21 Jul 2015 20:35:27 +0000 (22:35 +0200)
src/main/java/net/pterodactylus/sone/core/SoneModificationDetector.java

index 5c1c021..71c28bb 100644 (file)
@@ -49,12 +49,12 @@ class SoneModificationDetector {
                        return false;
                }
                String fingerprint = lockableFingerprintProvider.getFingerprint();
-               if (originalFingerprint.equals(fingerprint)) {
+               if (fingerprint.equals(originalFingerprint)) {
                        lastModificationTime = absent();
                        lastFingerprint = fingerprint;
                        return false;
                }
-               if (!lastFingerprint.equals(fingerprint)) {
+               if (!Objects.equal(lastFingerprint, fingerprint)) {
                        lastModificationTime = of(ticker.read());
                        lastFingerprint = fingerprint;
                        return false;