Skip to content

Commit a20c752

Browse files
committed
Handle an edge case
1 parent baea5cb commit a20c752

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

SabreTools.IO/Streams/ViewStream.cs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,13 @@ public string? Filename
2626
{
2727
get
2828
{
29-
// Only file streams can have a filename
30-
if (_source is not FileStream fs)
31-
return null;
29+
// A subset of streams have a filename
30+
if (_source is FileStream fs)
31+
return fs.Name;
32+
else if (_source is ViewStream vs)
33+
return vs.Filename;
3234

33-
// Return the name
34-
return fs.Name;
35+
return null;
3536
}
3637
}
3738

0 commit comments

Comments
 (0)