mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Dispose only if there's something to dispose
This commit is contained in:
@@ -456,13 +456,19 @@ namespace SabreTools
|
|||||||
catch (InvalidOperationException)
|
catch (InvalidOperationException)
|
||||||
{
|
{
|
||||||
encounteredErrors = true;
|
encounteredErrors = true;
|
||||||
archive.Dispose();
|
if (archive != null)
|
||||||
|
{
|
||||||
|
archive.Dispose();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
_logger.Error(ex.ToString());
|
_logger.Error(ex.ToString());
|
||||||
encounteredErrors = true;
|
encounteredErrors = true;
|
||||||
archive.Dispose();
|
if (archive != null)
|
||||||
|
{
|
||||||
|
archive.Dispose();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ namespace SabreTools.Helper
|
|||||||
/// - Create log files by date
|
/// - Create log files by date
|
||||||
/// - Clean up log files if there are more than x number per program
|
/// - Clean up log files if there are more than x number per program
|
||||||
/// - Allow for "triggerable" logging done on an interval (async)
|
/// - Allow for "triggerable" logging done on an interval (async)
|
||||||
/// - Log filtering?
|
/// - Log filtering? (#if debug?)
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
public class Logger
|
public class Logger
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user