1
0
Fork 0
mirror of https://github.com/syncthing/syncthing-android.git synced 2024-11-29 15:51:17 +00:00

Fix NPE in offline config reader (fixes #316)

after folder has been created while Syncthing was not running
This commit is contained in:
Catfriend1 2019-02-10 13:47:11 +01:00
parent cfa6ce4e3b
commit 3a7705bde6

View file

@ -459,8 +459,10 @@ public class ConfigXml {
*/
folder.minDiskFree = new Folder.MinDiskFree();
Element elementMinDiskFree = (Element) r.getElementsByTagName("minDiskFree").item(0);
if (elementMinDiskFree != null) {
folder.minDiskFree.unit = getAttributeOrDefault(elementMinDiskFree, "unit", "%");
folder.minDiskFree.value = getContentOrDefault(elementMinDiskFree, 1f);
}
// Log.v(TAG, "folder.minDiskFree.unit=" + folder.minDiskFree.unit + ", folder.minDiskFree.value=" + folder.minDiskFree.value);
// Versioning