Skip to content

Commit 927b4eb

Browse files
committed
Allow snapshot and op to be a non-object
1 parent 68bde00 commit 927b4eb

File tree

4 files changed

+1520
-1
lines changed

4 files changed

+1520
-1
lines changed

lib/ot.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ exports.apply = function(snapshot, op) {
102102
function applyOpEdit(snapshot, edit) {
103103
if (!snapshot.type) return {code: 4015, message: 'Document does not exist'};
104104

105-
if (typeof edit !== 'object') return {code: 5004, message: 'Missing op'};
105+
if (edit == null) return {code: 5004, message: 'Missing op'};
106106
var type = types[snapshot.type];
107107
if (!type) return {code: 4008, message: 'Unknown type'};
108108

0 commit comments

Comments
 (0)