Ensure lock data is initialized before interacting with it

parent 1a49e8f9
......@@ -57,6 +57,13 @@ function clearCaches( lockName ) {
// Reset lock connection
function disconnectAndClear( lockName ) {
var lock = app.get( 'lock' + lockName );
if ( ! lock ) {
clearCaches( lockName );
res.sendStatus( 400 );
return;
}
lock.disconnect();
clearCaches( lockName );
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment