[Groonga-commit] ranguba/chupa-text at a1ff607 [master] Add missing nil check

Back to archive index
Kouhei Sutou null+****@clear*****
Sun Mar 3 05:06:25 JST 2019


Kouhei Sutou	2019-03-03 05:06:25 +0900 (Sun, 03 Mar 2019)

  Revision: a1ff607cfb1335c52e94f4b69b8a6e74f86284a7
  https://github.com/ranguba/chupa-text/commit/a1ff607cfb1335c52e94f4b69b8a6e74f86284a7

  Message:
    Add missing nil check

  Modified files:
    lib/chupa-text/data.rb

  Modified: lib/chupa-text/data.rb (+3 -1)
===================================================================
--- lib/chupa-text/data.rb    2019-03-03 05:00:03 +0900 (9dd7ca8)
+++ lib/chupa-text/data.rb    2019-03-03 05:06:25 +0900 (b156499)
@@ -141,7 +141,9 @@ module ChupaText
     end
 
     def peek_body(size)
-      body[0, size]
+      _body = body
+      return nil if _body.nil?
+      _body[0, size]
     end
 
     def [](name)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.osdn.me/mailman/archives/groonga-commit/attachments/20190303/f0fefe7e/attachment.html>


More information about the Groonga-commit mailing list
Back to archive index