Skip to content

Commit

Permalink
Merge branch 'hotfix/1.2.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
markuskreusch committed Apr 25, 2017
2 parents 831cc0a + 62b73c0 commit 4e87134
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.cryptomator</groupId>
<artifactId>cryptofs</artifactId>
<version>1.2.0</version>
<version>1.2.1</version>
<name>Cryptomator Crypto Filesystem</name>
<description>This library provides the Java filesystem provider used by Cryptomator.</description>
<url>https://github.com/cryptomator/cryptofs</url>
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/org/cryptomator/cryptofs/CryptoPath.java
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,10 @@ public CryptoPath getParent() {
if (elementCount > 1) {
List<String> elems = elements.subList(0, elementCount - 1);
return copyWithElements(elems);
} else {
} else if (elementCount == 1) {
return getRoot();
} else {
return null;
}
}

Expand Down
2 changes: 2 additions & 0 deletions src/test/java/org/cryptomator/cryptofs/CryptoPathTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,13 @@ public void testGetParent() {
Path p1 = path("/foo");
Path p2 = path("/foo/bar");
Path p3 = path("foo");
Path p4 = path("/");

Assert.assertEquals(p1, p2.getParent());
Assert.assertEquals(rootPath, p1.getParent());
Assert.assertNull(emptyPath.getParent());
Assert.assertNull(p3.getParent());
Assert.assertNull(p4.getParent());
}

@Test
Expand Down

0 comments on commit 4e87134

Please sign in to comment.