FIX: Check if arguments are valid (#26)

FIX: Check if arguments are valid (#26)

Topic.create() used to throw a TypeError because it expected arguments[0] to exist and be an Object.

diff --git a/assets/javascripts/discourse/initializers/hook-gather-keys.js.es6 b/assets/javascripts/discourse/initializers/hook-gather-keys.js.es6
index 848d822..d260feb 100644
--- a/assets/javascripts/discourse/initializers/hook-gather-keys.js.es6
+++ b/assets/javascripts/discourse/initializers/hook-gather-keys.js.es6
@@ -56,7 +56,7 @@ export default {
     // Hook `Topic` model to gather encrypted topic keys.
     Topic.reopenClass({
       create(args) {
-        if (args.topic_key) {
+        if (args && args.topic_key) {
           putTopicKey(args.id, args.topic_key);
           putTopicTitle(args.id, args.encrypted_title);
         }

GitHub sha: 4bf5e203

This commit appears in #26 which was approved by ZogStriP. It was merged by udan11.