Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ext/java/org/msgpack/jruby/Factory.java
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public IRubyObject registerTypeInternal(ThreadContext ctx, IRubyObject type, IRu
extensionRegistry.put(extModule, (int) typeId, recursive, packerProc, unpackerProc);

if (extModule == runtime.getSymbol()) {
hasSymbolExtType = !packerProc.isNil();
hasSymbolExtType = packerProc != null && !packerProc.isNil();
}

if (options != null) {
Expand Down
6 changes: 6 additions & 0 deletions spec/factory_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,12 @@ class MyType2 < MyType
expect(factory.load(factory.dump(:foo))).to be == "foo"
end

it 'handles Symbol type registered with only an unpacker' do
factory = MessagePack::Factory.new
factory.register_type(0x00, Symbol, unpacker: :to_sym.to_proc)
expect(factory.load(factory.dump(:foo))).to be == "foo"
end

describe "registering multiple ext type for the same class" do
let(:payload) do
factory = MessagePack::Factory.new
Expand Down
Loading