Pārlūkot izejas kodu

Fix out-of-scope `input` reference in try_emo_ji() (#2)

try_emo_ji() is a top-level helper (a lexical sibling of the Shiny
server closure), so `input$emoji$name` was unbound there and the
tryCatch() silently swallowed the error, making the 'try raw name
first' branch dead code. Use the `name` parameter, which already
holds input$emoji$name (passed by the caller).

Found via ry v0.6.1 RY010 (unbound-variable).
main
Maximilian Scholz pirms 2 mēnešiem
vecāks
revīzija
5625195acb
Revīzijas autora e-pasta adrese nav piesaistīta nevienam kontam
1 mainītis faili ar 2 papildinājumiem un 2 dzēšanām
  1. +2
    -2
      R/emoji_picker.R

+ 2
- 2
R/emoji_picker.R Parādīt failu

@@ -160,8 +160,8 @@ emoji_picker_server <- function(quick_add = TRUE, context = NULL) {

try_emo_ji <- function(name, session = shiny::getDefaultReactiveDomain()) {
emo_ji <- tryCatch({
emo::ji(input$emoji$name)
paste0('emo::ji("', input$emoji$name, '")')
emo::ji(name)
paste0('emo::ji("', name, '")')
},
error = function(e) {
NULL

Notiek ielāde…
Atcelt
Saglabāt