]> git.donarmstrong.com Git - biopieces.git/commitdiff
small safety add in genbank.rb
authormartinahansen <martinahansen@74ccb610-7750-0410-82ae-013aeee3265d>
Thu, 9 Dec 2010 15:23:59 +0000 (15:23 +0000)
committermartinahansen <martinahansen@74ccb610-7750-0410-82ae-013aeee3265d>
Thu, 9 Dec 2010 15:23:59 +0000 (15:23 +0000)
git-svn-id: http://biopieces.googlecode.com/svn/trunk@1176 74ccb610-7750-0410-82ae-013aeee3265d

code_ruby/Maasha/lib/genbank.rb

index 0c1c0f327f1a086d1b588fde1f4103e5483a4305..a2ce72ad33a584d57e610da2afef28661178ae6f 100644 (file)
@@ -128,14 +128,14 @@ class Genbank
     i    = 0
     j    = 0
 
-    while @entry[i] !~ /^FEATURES/
+    while @entry[i] and @entry[i] !~ /^FEATURES/
       if @entry[i] =~ /^\s{0,3}([A-Z]{2})/
         if want_key?(hash_keys, $1)
           j = i + 1
 
           key, val = @entry[i].lstrip.split(/\s+/, 2)
 
-          while @entry[j] !~ /^\s{0,3}[A-Z]/
+          while @entry[j] and @entry[j] !~ /^\s{0,3}[A-Z]/
             val << @entry[j].lstrip
             j += 1
           end