Skip to content

Commit 257cad1

Browse files
authored
Merge pull request #1162 from Iscle/master
Fix bug with mounts that didn't have a target point set (Issue #1161)
2 parents 5632c41 + c4acc4e commit 257cad1

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

app/src/main/java/ru/meefik/linuxdeploy/adapter/MountAdapter.java

+10-2
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,23 @@ public void setMounts(List<String> mounts) {
5656
this.mounts.clear();
5757
for (String mount : mounts) {
5858
String[] tmp = mount.split(":", 2);
59-
this.mounts.add(new Mount(tmp[0], tmp[1]));
59+
if (tmp.length > 1) {
60+
this.mounts.add(new Mount(tmp[0], tmp[1]));
61+
} else {
62+
this.mounts.add(new Mount(tmp[0], ""));
63+
}
6064
}
6165
notifyDataSetChanged();
6266
}
6367

6468
public List<String> getMounts() {
6569
List<String> mounts = new ArrayList<>();
6670
for (Mount mount : this.mounts) {
67-
mounts.add(mount.getSource() + ":" + mount.getTarget());
71+
if (mount.getTarget().isEmpty()) {
72+
mounts.add(mount.getSource());
73+
} else {
74+
mounts.add(mount.getSource() + ":" + mount.getTarget());
75+
}
6876
}
6977
return mounts;
7078
}

0 commit comments

Comments
 (0)