Combo Select Filter Data

*** controller **
def filtro
    if !params[:filtro][:campo].nil?
      tipo_filtro = params[:filtro][:campo]
        @inmobiliaria = Inmobiliaria.find(params[:id])
      proyecto = @inmobiliaria.proyectos_inmobiliarios.find(:all,
:conditions => ['tipo_propiedad_id = ?',tipo_filtro])
    @proyectos = proyecto.paginate :page => params[:page], :per_page =>
    @numero_proyectos = proyecto.size
        render :partial => "resultado_inmobiliaria", :layout => false,
:object => @proyectos

ups the error

You have a nil object when you didn't expect it!
You might have expected an instance of ActiveRecord::Base.
The error occurred while evaluating nil.[]


if params[:filtro] && !params[:filtro][:campo].nil?


if (params[:filtro][:campo] rescue false)

if there's no params[:filtro], the chained call to [:campo] will cause
that error.