mirror of
https://github.com/jaquadro/NBTExplorer.git
synced 2025-01-09 17:36:25 +00:00
fix absolute path crash
This commit is contained in:
parent
b303551fa0
commit
e1096e29ca
1 changed files with 1 additions and 1 deletions
|
@ -33,7 +33,7 @@ namespace NBTExplorer.Model
|
|||
{
|
||||
string path = (_path.EndsWith("/") || _path.EndsWith("\\")) ? _path : _path + '/';
|
||||
|
||||
string name = Path.GetDirectoryName(path);
|
||||
string name = Path.GetDirectoryName(path) ?? path.Substring(0, path.Length - 1);
|
||||
int sepIndex = Math.Max(name.LastIndexOf('/'), name.LastIndexOf('\\'));
|
||||
|
||||
return (sepIndex > 0) ? name.Substring(sepIndex + 1) : name;
|
||||
|
|
Loading…
Reference in a new issue