#923: Fix for crash when adding todo from mobile view.

This commit is contained in:
Henrik Bohre 2009-07-18 23:50:39 +02:00 committed by Eric Allen
parent 1f45497a52
commit dc08cbe76f

View file

@ -221,9 +221,10 @@ class Todo < ActiveRecord::Base
# TODO: Handle todos with the same description
# TODO: Should possibly handle state changes also?
def add_predecessor_list(predecessor_list)
raise "Can't handle other types than string for now" unless predecessor_list.kind_of? String
@predecessor_array = predecessor_list.split(',').map do |description|
description.strip.squeeze(" ")
if predecessor_list.kind_of? String
@predecessor_array = predecessor_list.split(',').map do |description|
description.strip.squeeze(" ")
end
end
end