[gnome-documents] selections: Be more strict about invalid code paths



commit 4ffdab6e83633a0b90444c1bbcdd7ce27affa955
Author: Debarshi Ray <debarshir gnome org>
Date:   Mon Mar 27 18:11:30 2017 +0200

    selections: Be more strict about invalid code paths
    
    https://bugzilla.gnome.org/show_bug.cgi?id=781532

 src/selections.js |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/src/selections.js b/src/selections.js
index f1f8bbe..2d87540 100644
--- a/src/selections.js
+++ b/src/selections.js
@@ -977,7 +977,7 @@ const SelectionToolbar = new Lang.Class({
     _onToolbarCollection: function() {
         let toplevel = this.get_toplevel();
         if (!toplevel.is_toplevel())
-            return;
+            throw(new Error('Code should not be reached'));
 
         let dialog = new OrganizeCollectionDialog(toplevel);
         dialog.connect('destroy', Lang.bind(this, function() {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]