editor: small fix
authorAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Mon, 9 Jun 2014 14:08:24 +0000 (16:08 +0200)
committerAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Mon, 9 Jun 2014 14:08:24 +0000 (16:08 +0200)
src/editor/plugins/core/lists.js

index 662dc53..7a9d321 100644 (file)
@@ -45,8 +45,9 @@ var toggleListAction = function(type) {
                         item1 = list.object.getItem(0),
                         text = item1 ? item1.contents()[0] : undefined, //
                         doc = boundries.node1.document;
-
-                   return doc.createFragment(doc.CaretFragment, {node: text, offset:0});
+                    if(text) {
+                        return doc.createFragment(doc.CaretFragment, {node: text, offset:0});
+                    }
                 }, {
                     metadata: {
                         description: action.getState().description,