File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -1470,6 +1470,14 @@ WApplication::UpdateLock::UpdateLock(WApplication *app)
14701470#ifndef WT_THREADED
14711471 return ;
14721472#else
1473+
1474+ // check if 'app' is a nullptr to prevent an access violation
1475+ // in the following code
1476+ if (!app ) {
1477+ ok_ = false;
1478+ return ;
1479+ }
1480+
14731481 /*
14741482 * If we are already handling this application, then we already have
14751483 * exclusive access, unless we are not having the lock (e.g. from a
@@ -1498,8 +1506,12 @@ WApplication::UpdateLock::UpdateLock(WApplication *app)
14981506 WebSession ::Handler * handler = WebSession ::Handler ::instance ();
14991507
15001508 createdHandler_ = false;
1501- if (handler && handler -> haveLock () && handler -> session () == app -> session_ )
1509+ if (!app ) {
1510+ return ;
1511+ }
1512+ if (handler && handler -> haveLock () && handler -> session () == app -> session_ ) {
15021513 return ;
1514+ }
15031515
15041516 new WebSession ::Handler (app -> session_ , WebSession ::Handler ::LockOption ::TakeLock );
15051517
You can’t perform that action at this time.
0 commit comments