Permalink
Browse files

* Fix bug where text is nil

  • Loading branch information...
1 parent 33d6a06 commit 94519d644fb560e364ca49d11be4846d1c65255c @donv donv committed Oct 16, 2012
Showing with 1 addition and 0 deletions.
  1. +1 −0 lib/gruff/base.rb
View
@@ -1094,6 +1094,7 @@ def calculate_caps_height(font_size)
# Not scaled since it deals with dimensions that the regular
# scaling will handle.
def calculate_width(font_size, text)
+ return 0 if text.nil?
@d.pointsize = font_size
@d.font = @font if @font
@d.get_type_metrics(@base_image, text.to_s).width

0 comments on commit 94519d6

Please sign in to comment.