That's because in the if statement you're checking that lines exist in the listbox, but you're not checking that a line is selected.

Code:
menu @Log*viewer { 
  lbclick {
    if ($sline($logwin(@Log viewer),1)) { 
      .clear $logwin(@Log viewer)
      .loadbuf $logwin(@Log viewer) $qt($+($logsdir,$sline($logwin(@Log viewer),1),.log))
    }
  }
}


Use $sline() instead of $line() in your if statement.