summaryrefslogtreecommitdiff
path: root/ext/json/lib/json/add
diff options
context:
space:
mode:
Diffstat (limited to 'ext/json/lib/json/add')
-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 4423e7ad75..7121a77ff1 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,