File tree Expand file tree Collapse file tree
src/main/java/org/jruby/ext/openssl Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -310,7 +310,7 @@ public IRubyObject to_text(final ThreadContext context) {
310310
311311 text .append ("Certificate:\n " );
312312 text .append (S20 ,0 ,4 ).append ("Data:\n " );
313- final int version = RubyNumeric .fix2int (this .version );
313+ final int version = this . version == null ? 0 : RubyNumeric .fix2int (this .version );
314314 text .append (S20 ,0 ,8 ).append ("Version: " ).append ( version + 1 ).
315315 append (" (0x" ).append ( Integer .toString ( version , 16 ) ).append (")\n " );
316316 text .append (S20 ,0 ,8 ).append ("Serial Number:\n " );
@@ -382,12 +382,12 @@ public IRubyObject inspect() {
382382
383383 @ JRubyMethod
384384 public IRubyObject version () {
385- return version ;
385+ return version != null ? version : ( version = getRuntime (). newFixnum ( 0 ) ) ;
386386 }
387387
388388 @ JRubyMethod (name = "version=" )
389389 public IRubyObject set_version (final IRubyObject version ) {
390- if ( ! version .equals (this . version ) ) {
390+ if ( ! version () .equals (version ) ) {
391391 this .changed = true ;
392392 }
393393 return this .version = version ;
You can’t perform that action at this time.
0 commit comments