File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
src/routes/copilotOpportunityApply Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -74,12 +74,17 @@ module.exports = [
74
74
req . log . debug ( subjects , 'all manager subjects' ) ;
75
75
76
76
const creator = await util . getMemberDetailsByUserIds ( [ opportunity . createdBy ] , req . log , req . id ) ;
77
-
78
77
req . log . debug ( creator , 'creator' , opportunity . createdBy ) ;
79
78
80
79
const listOfSubjects = subjects ;
81
- if ( creator ) {
82
- const isCreatorPartofSubjects = subjects . find ( item => item . email . toLowerCase ( ) === creator [ 0 ] . email . toLowerCase ( ) ) ;
80
+ if ( creator && creator [ 0 ] && creator [ 0 ] . email ) {
81
+ const isCreatorPartofSubjects = subjects . find ( item => {
82
+ if ( ! item . email ) {
83
+ return false ;
84
+ }
85
+
86
+ return item . email . toLowerCase ( ) === creator [ 0 ] . email . toLowerCase ( ) ;
87
+ } ) ;
83
88
req . log . debug ( isCreatorPartofSubjects , 'isCreatorPartofSubjects' ) ;
84
89
if ( ! isCreatorPartofSubjects ) {
85
90
listOfSubjects . push ( {
You can’t perform that action at this time.
0 commit comments