aeolus-incubator / tim

Web application for managing virtual images to be deployed in the cloud
www.aeolusproject.org
MIT License
3 stars 6 forks source link

TargetImagesController#factory_keys should guard against params[:target_image] being nil #93

Open n1zyy opened 11 years ago

n1zyy commented 11 years ago

This is probably an edge case (it was only exposed by a separate bug (not in Tim) causing data to be posted to the wrong URL), but the factory_keys method in TargetImagesController begins by checking params[:target_image][:percent_complete].

params[:target_image] can be nil, at least in the case of bad data being passed in, causing the method to raise an undefined method[]' for nil:NilClass` exception.