diff --git a/reviewboard/static/rb/js/views/abstractReviewableView.es6.js b/reviewboard/static/rb/js/views/abstractReviewableView.es6.js
index d6ee93fc03ea747cfdf51b0edc377c1ac38979d1..7ed3ab0ccd95f847d84d585ec1b69122f1f5ffb5 100644
--- a/reviewboard/static/rb/js/views/abstractReviewableView.es6.js
+++ b/reviewboard/static/rb/js/views/abstractReviewableView.es6.js
@@ -106,13 +106,23 @@ RB.AbstractReviewableView = Backbone.View.extend({
             return;
         }
 
-        this.stopListening(this.commentDlg, 'closed');
-        this.commentDlg = RB.CommentDialogView.create({
+        const newCommentDlg =  RB.CommentDialogView.create({
             comment: commentBlock.get('draftComment'),
             publishedComments: commentBlock.get('serializedComments'),
             publishedCommentsType: this.commentsListName,
             position: dlg => commentBlockView.positionCommentDlg(dlg),
         });
+        if (!newCommentDlg){
+            /* 
+             * New dialog cannot be created due to an 
+             * unsaved existing dialog.
+             */
+            commentBlock.attributes.draftComment.destroyIfEmpty();
+            return;
+        }
+        this.stopListening(this.commentDlg, 'closed');
+
+        this.commentDlg = newCommentDlg;
         this._activeCommentBlock = commentBlock;
 
         this.listenTo(this.commentDlg, 'closed', () => {
diff --git a/reviewboard/static/rb/js/views/commentDialogView.js b/reviewboard/static/rb/js/views/commentDialogView.js
index 5713f8ef035a5f0f2d95896e2dbb0154cc9a9b02..1d643869667acbf54793223202c457437f61bb28 100644
--- a/reviewboard/static/rb/js/views/commentDialogView.js
+++ b/reviewboard/static/rb/js/views/commentDialogView.js
@@ -613,6 +613,12 @@ RB.CommentDialogView = Backbone.View.extend({
             x,
             y;
 
+        if (instance &&
+            instance.model.get('dirty') &&
+            !confirm(gettext('You have unsaved changes, are you sure you want to exit?'))){
+            return null;
+        }      
+
         function showCommentDlg() {
             try {
                 dlg.open();
