Skip to content

Commit 6ce0e42

Browse files
committed
fix: initProc null
Signed-off-by: okhowang(王沛文) <okhowang@tencent.com>
1 parent b70bd38 commit 6ce0e42

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

handler/implementations/passThrough.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,8 @@ func (h *PassThrough) ReadWithNS(
223223
// read. That is, the handler's Read() method is normally invoked twice: the
224224
// first read returns X bytes, the second read returns 0 bytes.
225225

226-
if domain.ProcessNsMatch(process, cntr.InitProc()) {
226+
initProc := cntr.InitProc()
227+
if initProc != nil && domain.ProcessNsMatch(process, initProc) {
227228

228229
cntr.Lock()
229230

@@ -309,7 +310,8 @@ func (h *PassThrough) WriteWithNS(
309310
// (not in inner containers or unshared namespaces) then cache the data.
310311
// See explanation in Read() method above.
311312

312-
if domain.ProcessNsMatch(process, cntr.InitProc()) {
313+
initProc := cntr.InitProc()
314+
if initProc != nil && domain.ProcessNsMatch(process, initProc) {
313315
if !req.NoCache {
314316
cntr.Lock()
315317
err = cntr.SetData(path, req.Offset, req.Data)

0 commit comments

Comments
 (0)