瀏覽代碼

Bugfix: when renaming a file, its text node is not available, updateItemNode was throwing errors.

Afshin Darian 8 年之前
父節點
當前提交
4ee91e0115
共有 1 個文件被更改,包括 7 次插入1 次删除
  1. 7 1
      src/filebrowser/listing.ts

+ 7 - 1
src/filebrowser/listing.ts

@@ -1477,7 +1477,11 @@ namespace DirListing {
         modTitle = dateTime(model.last_modified);
       }
 
-      text.textContent = model.name;
+      // If an item is being edited currently, its text node is unavailable.
+      if (text) {
+        text.textContent = model.name;
+      }
+
       modified.textContent = modText;
       modified.title = modTitle;
     }
@@ -1580,6 +1584,8 @@ namespace Private {
           changed = false;
           edit.blur();
           break;
+        default:
+          break;
         }
       };
     });