From 70db1699769dd850867eb6eaf48256ebcaeb6f68 Mon Sep 17 00:00:00 2001 From: Johannes Zellner Date: Wed, 6 Feb 2019 16:18:12 +0100 Subject: [PATCH] eventId in notifications may be null --- src/notifications.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/notifications.js b/src/notifications.js index 185a6a092..9789612dd 100644 --- a/src/notifications.js +++ b/src/notifications.js @@ -56,7 +56,7 @@ NotificationsError.NOT_FOUND = 'Not Found'; function add(userId, eventId, title, message, action, callback) { assert.strictEqual(typeof userId, 'string'); - assert.strictEqual(typeof eventId, 'string'); + assert(typeof eventId === 'string' || eventId === null); assert.strictEqual(typeof title, 'string'); assert.strictEqual(typeof message, 'string'); assert.strictEqual(typeof action, 'string'); @@ -80,7 +80,7 @@ function add(userId, eventId, title, message, action, callback) { function upsert(userId, eventId, title, message, action, callback) { assert.strictEqual(typeof userId, 'string'); - assert.strictEqual(typeof eventId, 'string'); + assert(typeof eventId === 'string' || eventId === null); assert.strictEqual(typeof title, 'string'); assert.strictEqual(typeof message, 'string'); assert.strictEqual(typeof action, 'string');