title: Message error with "invalid argument" in shiny inputs
body: <p>I want to add a condition to this code to avoid a message error when my different selectinputs are empty. I tried to use <code>req()</code> in reactive expression but doesnt work. I also tried to add a condition like <code>if(input$name == NULL){return(NULL)}</code> for different inputs but doesnt work too ..</p>
  
  <p>Any help wil be appreciated</p>
  
  <p>Code :</p>
  
  <pre><code>l &lt;- NULL
  l$name &lt;- c('b','e','d','b','b','d','e','e','b','b')
  l$age &lt;- c(20,20,21,21,20,22,22,30,21,32)
  l$gender &lt;- c('Female', 'Female', 'Male', 'Female', 'Male','Male', 
                'Female','Male',"Female","Male")
  l &lt;- as.data.frame(l)
  l$name &lt;- as.character(l$name)
  l$age &lt;- as.numeric(l$age)
  l$gender &lt;- as.character(l$gender)
  
  
  library(shiny)
  server &lt;- shinyServer(function(input,output){
  
    assign('All Names', unique(sort(l$name)))
    assign("All Ages", unique(sort(l$age)))
    assign('All Genders', unique(sort(l$gender)))
  
    data1 &lt;- reactive(l[which(l$name %in% if(exists(input$name))
    {get(input$name)}else{input$name}),])
  
  
    data2 &lt;- reactive(data1()[which(data1()$age %in% if(exists(input$age))
    {get(input$age)}else{input$age}),])
  
  
    data3 &lt;- eventReactive(input$go_baba, {
      data2()[which(data2()$gender %in% if(exists(input$gender))
      {get(input$gender)}else{input$gender}),]
    })
  
    output$table3 &lt;- renderTable(data3())
  
  
    output$Box1 =  renderUI(
      if((is.null(input$age)) &amp; (is.null(input$gender))){
        selectInput("name", "Choose Name", choices=c("All Names",unique(sort(l$name))), selected = input$name)
      } else{selectInput("name", "Choose Name", choices=c("All Names",unique(l[l$gender %in% (if(exists(input$gender)){get(input$gender)}else{input$gender}) &amp; l$age %in% (if(exists(input$age)){get(input$age)}else{input$age}) , "name"])), selected = input$name, multiple = T)
      }
    )
  
  
  
    output$Box2 =  renderUI(
      if((is.null(input$name)) &amp; (is.null(input$gender))){
        selectInput("age", "Choose Age", choices=c("All Ages", unique(sort(l$age))), selected = input$age)
      }else{selectInput("age", "Choose Age", choices=c("All Ages",unique(l[l$gender %in% (if(exists(input$gender)){get(input$gender)}else{input$gender}) &amp; l$name %in% (if(exists(input$name)){get(input$name)}else{input$name}) , "age"])), selected = input$age, multiple = T)}
    )
  
    output$Box3 =  renderUI(
      if((is.null(input$name)) &amp; (is.null(input$age))){
        selectInput("gender", "Choose Gender", choices=c("All Genders", unique(sort(l$gender))), selected = input$gender)
      }else{
  
        selectInput("gender", "Choose Gender", choices=c("All Genders", unique(l[l$name %in% (if(exists(input$name)){get(input$name)}else{input$name}) &amp; l$age %in% (if(exists(input$age)){get(input$age)}else{input$age}), "gender"])), selected = input$gender, multiple = TRUE)
      }
    )
  
  
  
  })
  
  ui &lt;-shinyUI(fluidPage(
    uiOutput("Box1"),
    uiOutput("Box2"),
    uiOutput("Box3"),
    actionButton("go_baba", "GO !"),
    tableOutput("table3")
  ))
  
  shinyApp(ui,server)
  </code></pre>