mirror of
https://github.com/syncthing/syncthing-android.git
synced 2024-12-02 01:01: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:
parent
cfa6ce4e3b
commit
3a7705bde6
1 changed files with 4 additions and 2 deletions
|
@ -459,8 +459,10 @@ public class ConfigXml {
|
||||||
*/
|
*/
|
||||||
folder.minDiskFree = new Folder.MinDiskFree();
|
folder.minDiskFree = new Folder.MinDiskFree();
|
||||||
Element elementMinDiskFree = (Element) r.getElementsByTagName("minDiskFree").item(0);
|
Element elementMinDiskFree = (Element) r.getElementsByTagName("minDiskFree").item(0);
|
||||||
folder.minDiskFree.unit = getAttributeOrDefault(elementMinDiskFree, "unit", "%");
|
if (elementMinDiskFree != null) {
|
||||||
folder.minDiskFree.value = getContentOrDefault(elementMinDiskFree, 1f);
|
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);
|
// Log.v(TAG, "folder.minDiskFree.unit=" + folder.minDiskFree.unit + ", folder.minDiskFree.value=" + folder.minDiskFree.value);
|
||||||
|
|
||||||
// Versioning
|
// Versioning
|
||||||
|
|
Loading…
Reference in a new issue