Add nil check for colors, just in case
Probably not possible, but provides a more descriptive error than before anyway. Fixes #84.
This commit is contained in:
@@ -30,6 +30,7 @@ module Squib
|
||||
# :nodoc:
|
||||
# @api private
|
||||
def set_source_squibcolor(arg)
|
||||
raise 'nil is not a valid color' if arg.nil?
|
||||
if match = arg.match(LINEAR_GRADIENT)
|
||||
x1, y1, x2, y2 = match.captures
|
||||
linear = Cairo::LinearPattern.new(x1.to_f, y1.to_f, x2.to_f, y2.to_f)
|
||||
@@ -82,4 +83,4 @@ module Squib
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user