Skip to content

Commit

Permalink
add type assertion checked
Browse files Browse the repository at this point in the history
License: MIT
Signed-off-by: Kejie Zhang <[email protected]>
  • Loading branch information
kjzz committed Sep 11, 2018
1 parent 9898ba9 commit 8ddb437
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions core/coreunix/add.go
Original file line number Diff line number Diff line change
Expand Up @@ -472,10 +472,12 @@ func (adder *Adder) addFile(file files.File) error {
}

addFileName := file.FileName()
addFileInfo := file.(files.FileInfo)
if addFileInfo.AbsPath() == os.Stdin.Name() && adder.Name != "" {
addFileName = adder.Name
adder.Name = ""
addFileInfo, ok := file.(files.FileInfo)
if ok {
if addFileInfo.AbsPath() == os.Stdin.Name() && adder.Name != "" {
addFileName = adder.Name
adder.Name = ""
}
}
// patch it into the root
return adder.addNode(dagnode, addFileName)
Expand Down

0 comments on commit 8ddb437

Please sign in to comment.