Skip to content

Commit 1af3642

Browse files
committed
fix: minor bug
1 parent 097326e commit 1af3642

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

R/tm_g_distribution.R

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1321,11 +1321,18 @@ srv_distribution <- function(id,
13211321

13221322
decorated_output_q <- reactive({
13231323
tab <- req(input$tabs) # tab is NULL upon app launch, hence will crash without this statement
1324-
if (tab == "Histogram") {
1325-
c(decorated_output_dist_q(), decorated_output_summary_q(), decorated_output_test_q())
1326-
} else if (tab == "QQplot") {
1327-
c(decorated_output_qq_q(), decorated_output_summary_q(), decorated_output_test_q())
1324+
test_q_out <- try(test_q(), silent = TRUE)
1325+
decorated_test_q_out <- if (inherits(test_q_out, c("try-error", "error"))) {
1326+
teal.code::qenv()
1327+
} else {
1328+
decorated_output_test_q()
13281329
}
1330+
1331+
out_q <- switch(tab,
1332+
Histogram = decorated_output_dist_q(),
1333+
QQplot = decorated_output_qq_q()
1334+
)
1335+
c(out_q, decorated_output_summary_q(), decorated_test_q_out)
13291336
})
13301337

13311338
dist_r <- reactive(req(decorated_output_dist_q())[["histogram_plot"]])

0 commit comments

Comments
 (0)