Shortcut checking for whether directories are files

This commit is contained in:
smoogipoo 2019-06-26 17:10:22 +09:00
parent 681759582b
commit 15b140b2ee
1 changed files with 4 additions and 0 deletions

View File

@ -2,6 +2,7 @@
// See the LICENCE file in the repository root for full licence text. // See the LICENCE file in the repository root for full licence text.
using System; using System;
using System.IO;
using SharpCompress.Archives.Zip; using SharpCompress.Archives.Zip;
namespace osu.Game.Utils namespace osu.Game.Utils
@ -10,6 +11,9 @@ public static class ZipUtils
{ {
public static bool IsZipArchive(string path) public static bool IsZipArchive(string path)
{ {
if (!File.Exists(path))
return false;
try try
{ {
using (var arc = ZipArchive.Open(path)) using (var arc = ZipArchive.Open(path))