Skip to content
Snippets Groups Projects
Verified Commit 9481a901 authored by Erick Hitter's avatar Erick Hitter
Browse files

Ensure lock data is initialized before interacting with it

parent 1a49e8f9
No related branches found
No related tags found
No related merge requests found
...@@ -57,6 +57,13 @@ function clearCaches( lockName ) { ...@@ -57,6 +57,13 @@ function clearCaches( lockName ) {
// Reset lock connection // Reset lock connection
function disconnectAndClear( lockName ) { function disconnectAndClear( lockName ) {
var lock = app.get( 'lock' + lockName );
if ( ! lock ) {
clearCaches( lockName );
res.sendStatus( 400 );
return;
}
lock.disconnect(); lock.disconnect();
clearCaches( lockName ); clearCaches( lockName );
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment