FIX: in some cases custom_fields can be null

FIX: in some cases custom_fields can be null

When figuring out version override in some cases custom_fields could be nil this would cause the version override to fail

diff --git a/plugin.rb b/plugin.rb
index 561dba2..a2f0ef2 100644
--- a/plugin.rb
+++ b/plugin.rb
@@ -153,11 +153,15 @@ after_initialize do
     # Hide version (staff) and public version (regular users) because post
     # revisions will not be decrypted.
     def version
-      topic&.custom_fields["encrypted_title"] ? 1 : super
+      has_encrypted_title? ? 1 : super
     end
 
     def public_version
-      topic&.custom_fields["encrypted_title"] ? 1 : super
+      has_encrypted_title? ? 1 : super
+    end
+
+    def has_encrypted_title?
+      !!(topic && topic.custom_fields && topic.custom_fields["encrypted_title"])
     end
   end

GitHub sha: 5c99fad1

FIX: excerpt will not work if custom fields is nil