mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
🐛Fix crashing if filter sends an IOException.
This commit is contained in:
@@ -32,6 +32,7 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using DiscImageChef.Console;
|
||||
@@ -66,9 +67,10 @@ namespace DiscImageChef.Filters
|
||||
/// <param name="path">Path</param>
|
||||
/// <returns>The filter that allows reading the specified path</returns>
|
||||
public IFilter GetFilter(string path)
|
||||
{
|
||||
try
|
||||
{
|
||||
IFilter noFilter = null;
|
||||
|
||||
foreach(IFilter filter in Filters.Values)
|
||||
if(filter.Id != new Guid("12345678-AAAA-BBBB-CCCC-123456789000"))
|
||||
{
|
||||
@@ -81,7 +83,8 @@ namespace DiscImageChef.Filters
|
||||
|
||||
if(foundFilter?.IsOpened() == true) return foundFilter;
|
||||
}
|
||||
else noFilter = filter;
|
||||
else
|
||||
noFilter = filter;
|
||||
|
||||
if(!noFilter?.Identify(path) == true) return noFilter;
|
||||
|
||||
@@ -89,6 +92,8 @@ namespace DiscImageChef.Filters
|
||||
|
||||
return noFilter;
|
||||
}
|
||||
catch(IOException) { return null; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets all known filters
|
||||
|
||||
Reference in New Issue
Block a user