fix NPE for invites

This commit is contained in:
Matthew Hodgson 2015-07-14 12:10:15 +01:00
parent 6b0167375c
commit 69d1844773
1 changed files with 6 additions and 1 deletions

View File

@ -17,7 +17,12 @@ limitations under the License.
'use strict'; 'use strict';
function tsOfNewestEvent(room) { function tsOfNewestEvent(room) {
return room.timeline[room.timeline.length - 1].getTs(); if (room.timeline.length) {
return room.timeline[room.timeline.length - 1].getTs();
}
else {
return Number.MAX_SAFE_INTEGER;
}
} }
function mostRecentActivityFirst(roomList) { function mostRecentActivityFirst(roomList) {