diff --git a/Duplicati/Library/Utility/Utility.cs b/Duplicati/Library/Utility/Utility.cs
index 038d3adad..5843328db 100644
--- a/Duplicati/Library/Utility/Utility.cs
+++ b/Duplicati/Library/Utility/Utility.cs
@@ -774,6 +774,18 @@ namespace Duplicati.Library.Utility
return (T)(object)flags;
}
+
+ ///
+ /// Parses an option with int value, returning the default value if the option is not found or cannot be parsed
+ ///
+ /// The set of options to look for the setting in
+ /// The value to look for in the settings
+ /// default value
+ ///
+ public static int ParseIntOption(IReadOnlyDictionary options, string value, int @default)
+ {
+ return options.TryGetValue(value, out var opt) && int.TryParse(opt ?? string.Empty, out var result) ? result : @default;
+ }
///
/// Converts a sequence of bytes to a hex string