Skip to content

Commit 05a2e5c

Browse files
committed
Don't assume every IO comes from a file.
1 parent 5076fba commit 05a2e5c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Abstract/ObjectHandle.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ Try to guess the path of an `IO` object. If it cannot be guessed, returns the
370370
empty string.
371371
"""
372372
function path(io::IO)
373-
if startswith(io.name, "<file ") && endswith(io.name, ">")
373+
if hasfield(typeof(io), :name) && startswith(io.name, "<file ") && endswith(io.name, ">")
374374
return abspath(io.name[7:end-1])
375375
end
376376
return ""

0 commit comments

Comments
 (0)