summaryrefslogtreecommitdiff
path: root/ext/json/lib/json/add/core.rb
diff options
context:
space:
mode:
Diffstat (limited to 'ext/json/lib/json/add/core.rb')
-rw-r--r--ext/json/lib/json/add/core.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/json/lib/json/add/core.rb b/ext/json/lib/json/add/core.rb
index 4423e7ad75a..7121a77ff1d 100644
--- a/ext/json/lib/json/add/core.rb
+++ b/ext/json/lib/json/add/core.rb
@@ -96,7 +96,7 @@ class Struct
def to_json(*args)
klass = self.class.name
- klass.to_s.empty? and raise JSON::JSONError, "Only named structs are supported!"
+ klass.nil? and raise JSON::JSONError, "Only named structs are supported!"
{
'json_class' => klass,
'v' => values,