1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Fix panic in validate context for build

Fixes #7611

Signed-off-by: Michael Crosby <michael@docker.com>
This commit is contained in:
Michael Crosby 2014-08-18 16:28:44 -07:00
parent 34438efffe
commit cd776cdd77

View file

@ -644,7 +644,7 @@ func ValidateContextDirectory(srcPath string, excludes []string) error {
// skip checking if symlinks point to non-existing files, such symlinks can be useful
// also skip named pipes, because they hanging on open
lstat, _ := os.Lstat(filePath)
if lstat.Mode()&(os.ModeSymlink|os.ModeNamedPipe) != 0 {
if lstat != nil && lstat.Mode()&(os.ModeSymlink|os.ModeNamedPipe) != 0 {
return nil
}