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:
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();
|
||||
Element elementMinDiskFree = (Element) r.getElementsByTagName("minDiskFree").item(0);
|
||||
folder.minDiskFree.unit = getAttributeOrDefault(elementMinDiskFree, "unit", "%");
|
||||
folder.minDiskFree.value = getContentOrDefault(elementMinDiskFree, 1f);
|
||||
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
|
||||
|
|
Loading…
Reference in a new issue