diff --git a/client/dcwebui.js b/client/dcwebui.js index 0063d9a..ef9367d 100644 --- a/client/dcwebui.js +++ b/client/dcwebui.js @@ -498,16 +498,15 @@ var maybeWriterFor = function(username) { }; var writerFor = function(username) { - var ret = maybeWriterFor(username); - - if (ret === null) { - // create new - tabid = tab_new(next_tabid++, username); - pm_tabs[username] = tabid; - return write(tabid); + var ret = maybeWriterFor(username); + if (ret !== null) { + return ret; // found } - return ret; + // create new + var tabid = tab_new(next_tabid++, username); + pm_tabs[username] = tabid; + return write(tabid); }; /* */