Skip to content

NPE when printing a variable in a view #4641

@alaz

Description

@alaz

Environment

  • JRuby: 9.1.9 and 9.1.10. Reverting to 9.1.8 fixes the problem
  • Operating system and platform: official Docker images
  • Application/framework version: Rails 5.0.3
  • Environment variables:
JRUBY_OPTS=--server  -Xjit.threshold=5 -Xjit.max=16384 -Xcompile.invokedynamic=false
JAVA_OPTS=-Xms1G -Xmx1G -XX:ReservedCodeCacheSize=128M -XX:+UseCodeCacheFlushing -Duser.timezone=GMT -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/logs -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -Dorg.apache.camel.jmx.serviceUrlPath=\"/jmxrmi\" -Dcom.sun.management.jmxremote.port=9073

Behavior

MRI and 9.1.8 show the template fine. 9.1.9 and 9.1.10 genrate a NPE:

I, [2017-06-01T15:53:49.906088 #1]  INFO -- : Write fragment views/pictures/asides/57ed3a75622e73832
132713ad509003d (1.1ms)
I, [2017-06-01T15:53:50.039642 #1]  INFO -- :   Rendered collection of admin/stream/pictures/_pictur
e.html.erb [50 times] (132.5ms)
I, [2017-06-01T15:53:50.043756 #1]  INFO -- :   Rendered admin/stream/pictures/hosted.html.erb withi
n layouts/admin (500.7ms)
I, [2017-06-01T15:53:50.044603 #1]  INFO -- : Completed 500 Internal Server Error in 536ms (ActiveRe
cord: 81.4ms)
F, [2017-06-01T15:53:50.046648 #1] FATAL -- :   
F, [2017-06-01T15:53:50.046784 #1] FATAL -- : ActionView::Template::Error (ExecutionException waiting for value: java.lang.NullPointerException):
F, [2017-06-01T15:53:50.047148 #1] FATAL -- :     32:           <%= @pagination_fine %>
    33:         </nav>
    34: 
    35:         <div class="row">
    36:           <%= render collection: @pictures, partial: 'picture', layout: 'col', cached: true 
%>
    37:         </div>
    38: 
F, [2017-06-01T15:53:50.047267 #1] FATAL -- :   
F, [2017-06-01T15:53:50.047405 #1] FATAL -- : app/views/admin/stream/pictures/hosted.html.erb:35:in `_app_views_admin_stream_pictures_hosted_html_erb___884846157_2150'

Sorry I failed to build a minimal example. Please tell me what options I should use to create a stack trace.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions