Permalink
Browse files

Don't try to restore from undefined state

  • Loading branch information...
1 parent 1644224 commit ef97e3162b84a008383467a629d9d7e57022fab8 @robarnold robarnold committed Jun 14, 2011
Showing with 5 additions and 1 deletion.
  1. +5 −1 sessionrestore.js
View
6 sessionrestore.js
@@ -17,7 +17,11 @@ exports.restore = function (createbackend) {
var backend;
for (name in session.db.channels) {
createbackend(name, function (backend) {
- channels.add(name, backend).restoreState(session.db.channels[name].state);
+ var state = session.db.channels[name].state;
+ var channel = channels.add(name, backend);
+ if (state !== undefined) {
+ channel.restoreState(state);
+ }
});
}
};

0 comments on commit ef97e31

Please sign in to comment.