       return
 
     repo = octo.repos(githubOrg, repo)
-    repo.pulls.fetch(state: "open").then (prs) ->
+    repo.pulls.fetch(state: "open")
+    .then (prs) ->
       return Promise.all prs.map (pr) ->
         if user?
           return if not pr.assignee?
-          assignee = lookupUserWithGithub pr.assignee
-          return if user.toLowerCase() isnt assignee.name.toLowerCase()
-
-        return repo.pulls(pr.number).fetch()
-    .then ( prs ) ->
-      message = ""
-      for pr in prs when pr
+          return lookupUserWithGithub(pr.assignee).then (assignee) ->
+            return if user.toLowerCase() isnt assignee?.name.toLowerCase()
+            return repo.pulls(pr.number).fetch()
+        else
+          return repo.pulls(pr.number).fetch()
+    .then (prs) ->
+      return Promise.all prs.map (pr) ->
+        return if not pr
         author = lookupUserWithGithub pr.user
         assignee = lookupUserWithGithub pr.assignee
+        return Promise.all [ pr, author, assignee ]
+    .then (prs) ->
+      message = ""
+      for p in prs when p
+        pr = p[0]
+        author = p[1]
+        assignee = p[2]
         message+= """
           *[#{pr.title}]* +#{pr.additions} -#{pr.deletions}
           #{pr.htmlUrl}

    robot.brain.set 'github-notifications', notifications

  lookupUserWithGithub = (github) ->
    if github
      users = robot.brain.users()
      users = _(users).keys().map (id) ->
        u = users[id]


      robot.messageRoom room, message
    .catch ( error ) ->
      console.log error.stack

  robot.respond /(?:github|gh|git) delete all notifications/i, (msg) ->
    notificationsCleared = clearAllNotificationsForRoom(findRoom(msg))
