Commit c32092e5ea4a736bab6836c77da8f253fa5fa281
1 parent
97d8d6ce88
Exists in
master
added condition on students fetch
Showing
1 changed file
with
2 additions
and
2 deletions
Show diff stats
imports/client/views/org/admin/students/index.js
... | ... | @@ -25,8 +25,8 @@ const meteorTick = (props, onData) => { |
25 | 25 | if(_.every(handles, (handle) => (handle.ready()) )) { |
26 | 26 | const user = Users.current(); |
27 | 27 | const org = Orgs.current(); |
28 | - students = Users.find({"role":"STUDENT"}).fetch(); | |
29 | - studentData = Students.find().fetch(); | |
28 | + students = Users.find({"role":"STUDENT"}).fetch() ? Users.find({"role":"STUDENT"}).fetch() : ""; | |
29 | + studentData = Students.find().fetch() ? Students.find().fetch() : ""; | |
30 | 30 | for(var i=0; i< students.length; i++){ |
31 | 31 | for(var j=0; j< studentData.length; j++){ |
32 | 32 | if(students[i]._id == studentData[j].userId){ | ... | ... |