Make equals() more robust
authorLennart Rosam <lennart@familie-rosam.de>
Fri, 25 May 2012 00:56:23 +0000 (02:56 +0200)
committerLennart Rosam <lennart@familie-rosam.de>
Fri, 25 May 2012 00:56:23 +0000 (02:56 +0200)
src/eu/alefzero/owncloud/datamodel/OCFile.java

index 336f95c..6861933 100644 (file)
@@ -334,8 +334,14 @@ public class OCFile implements Parcelable, Comparable<OCFile> {
     }
 
     public boolean equals(Object o) {
     }
 
     public boolean equals(Object o) {
-        OCFile that = (OCFile) o;
-        return this.mId == that.mId;
+        if(o instanceof OCFile){
+            OCFile that = (OCFile) o;
+            if(that != null){
+                return this.mId == that.mId;
+            }
+        }
+        
+        return false;
     }
 
     @Override
     }
 
     @Override