Permalink
Browse files

Follow JRuby's change to avoid NPE

JRuby [master be4fc7941bff50f6c90210a1d9e9178ffc05adda] does not allow
imClass to be null.
  • Loading branch information...
1 parent c8a133f commit 9f3a2491e8af11f21d78a2673d1f8943e8a9df9f @nahi nahi committed Jan 17, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 src/java/org/jruby/ext/openssl/SSLContext.java
@@ -509,7 +509,8 @@ private long getOptions() {
private X509Cert[] convertToX509Certs(IRubyObject value) {
final ArrayList<X509Cert> result = new ArrayList<X509Cert>();
ThreadContext ctx = getRuntime().getCurrentContext();
- RuntimeHelpers.invoke(ctx, value, "each", CallBlock.newCallClosure(value, null, Arity.NO_ARGUMENTS, new BlockCallback() {
+ RubyClass klass = Utils.getClassFromPath(ctx.runtime, "OpenSSL::SSL::SSLContext");
+ RuntimeHelpers.invoke(ctx, value, "each", CallBlock.newCallClosure(value, klass, Arity.NO_ARGUMENTS, new BlockCallback() {
public IRubyObject call(ThreadContext context, IRubyObject[] args, Block block) {
Utils.checkKind(getRuntime(), args[0], "OpenSSL::X509::Certificate");

0 comments on commit 9f3a249

Please sign in to comment.