Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Prevent a common warning, accessing an undefined instance variable #167

Closed
wants to merge 1 commit into from

2 participants

@benlangfeld

No description provided.

@obrie
Owner

Which runtime generates this warning? I've never noticed it in any tests.

@obrie obrie was assigned
@benlangfeld

CRuby 1.9.3, but only if you run ruby with -w. There are several others, but this is the one that occurs most in my projects which depend on state_machine.

@obrie
Owner

Ah, I gotcha. Thanks, I'll take a look at this sometime in the next week.

@obrie obrie closed this in 355d20b
@obrie
Owner

Hopefully should never see any warnings again from state_machine :) Definitely file a bug if you encounter any more!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  lib/state_machine/transition.rb
View
2  lib/state_machine/transition.rb
@@ -343,7 +343,7 @@ def pausable
raise unless @resume_block
end
- if @resume_block
+ if instance_variable_defined?(:@resume_block) && @resume_block
@resume_block.call(halted, error)
else
halted
Something went wrong with that request. Please try again.