aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Ranke <jranke@uni-bremen.de>2014-10-16 11:26:15 +0200
committerJohannes Ranke <jranke@uni-bremen.de>2014-10-16 11:26:15 +0200
commit171065ff333670747ee8e12ea55b430a6675c373 (patch)
treea50d2bf80ec3d5507c1b82e5d2f9b89939997924
parent27a6c4418ec39c473e02fefa062b1e077553525e (diff)
Fix for the case that a workspace has no fits
-rw-r--r--inst/GUI/gmkin.R21
1 files changed, 13 insertions, 8 deletions
diff --git a/inst/GUI/gmkin.R b/inst/GUI/gmkin.R
index 7932331..1a18be0 100644
--- a/inst/GUI/gmkin.R
+++ b/inst/GUI/gmkin.R
@@ -116,15 +116,20 @@ upload_file_handler <- function(h, ...)
workspace <- get(project_name)
# Check for old workspaces created using mkin < 0.9-32 that aren't loaded properly
- if (is.null(workspace$f[[1]]$method.modFit)) {
- stopmessage <- paste("Could not load workspace ",
- project_file,
- ". It seems it was created using mkin with version < 0.9-32",
- sep = "")
- galert(stopmessage, parent = w)
- svalue(sb) <- stopmessage
- } else {
+ workspace_old <- FALSE
+ if (length(workspace$f) > 0) {
+ if (is.null(workspace$f[[1]]$method.modFit)) {
+ stopmessage <- paste("Could not load workspace ",
+ project_file,
+ ". It seems it was created using mkin with version < 0.9-32",
+ sep = "")
+ galert(stopmessage, parent = w)
+ svalue(sb) <- stopmessage
+ workspace_old <- TRUE
+ }
+ }
+ if (!workspace_old) {
# Update project file name and status bar
svalue(pr.ge) <- project_name
svalue(sb) <- paste("Loaded project file", project_file)

Contact - Imprint