yangwwei commented on a change in pull request #302:
URL: 
https://github.com/apache/incubator-yunikorn-k8shim/pull/302#discussion_r707875369



##########
File path: pkg/cache/placeholder_manager.go
##########
@@ -61,6 +61,11 @@ func NewPlaceholderManager(clients *client.Clients) 
*PlaceholderManager {
 }
 
 func getPlaceholderManager() *PlaceholderManager {
+       placeholderMgr.RLock()
+       defer placeholderMgr.RUnlock()
+       if placeholderMgr == nil {
+               return nil

Review comment:
       need to put the nil check upfront
   
   ```
   if placeholderMgr == nil {
                return nil
   }
   placeholderMgr.RLock()
   defer placeholderMgr.RUnlock()
   ...
   
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to