mirror of
https://github.com/crskycode/GARbro.git
synced 2025-01-11 20:39:29 +08:00
consider empty IResource.Extensions property.
This commit is contained in:
parent
693d4dfa59
commit
c4f9c1ed47
@ -89,7 +89,7 @@ namespace GARbro.GUI
|
||||
var filters = new StringBuilder();
|
||||
|
||||
var format = this.ArchiveFormat.SelectedItem as ArchiveFormat;
|
||||
if (null != format)
|
||||
if (null != format && format.Extensions.Any())
|
||||
{
|
||||
var patterns = format.Extensions.Select (ext => "*."+ext);
|
||||
filters.Append (format.Description);
|
||||
|
@ -194,7 +194,7 @@ namespace GARbro.GUI
|
||||
string source_ext = Path.GetExtension (filename).TrimStart ('.').ToLowerInvariant();
|
||||
if (m_image_format.Extensions.Any (ext => ext == source_ext))
|
||||
return;
|
||||
string target_ext = m_image_format.Extensions.First();
|
||||
string target_ext = m_image_format.Extensions.FirstOrDefault();
|
||||
string target_name = Path.ChangeExtension (filename, target_ext);
|
||||
using (var file = File.OpenRead (filename))
|
||||
{
|
||||
|
@ -312,7 +312,7 @@ namespace GARbro.GUI
|
||||
if (null == src_format)
|
||||
throw new InvalidFormatException (string.Format ("{1}: {0}", guiStrings.MsgUnableInterpretImage, entry.Name));
|
||||
file.Position = 0;
|
||||
string target_ext = target_format.Extensions.First();
|
||||
string target_ext = target_format.Extensions.FirstOrDefault() ?? "";
|
||||
string outname = FindUniqueFileName (entry.Name, target_ext);
|
||||
if (src_format.Item1 == target_format)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user