diff --git a/iocore/eventsystem/I_Lock.h b/iocore/eventsystem/I_Lock.h index b5bef2c40e0..d599be26b06 100644 --- a/iocore/eventsystem/I_Lock.h +++ b/iocore/eventsystem/I_Lock.h @@ -353,17 +353,19 @@ class MutexLock Ptr &am, EThread *t) : m(am), locked_p(true) { - Mutex_lock( + if (am) { + Mutex_lock( #ifdef DEBUG - location, ahandler, + location, ahandler, #endif // DEBUG - m, t); + m, t); + } } void release() { - if (locked_p) { + if (locked_p && m) { Mutex_unlock(m, m->thread_holding); } locked_p = false;