From: <li...@us...> - 2011-12-30 18:39:55
|
Revision: 238 http://bugs-r.svn.sourceforge.net/bugs-r/?rev=238&view=rev Author: ligges Date: 2011-12-30 18:39:49 +0000 (Fri, 30 Dec 2011) Log Message: ----------- protect against crash in samplesSample("nonExistingNode") Modified Paths: -------------- trunk/BRugs/R/samples.sample.R Modified: trunk/BRugs/R/samples.sample.R =================================================================== --- trunk/BRugs/R/samples.sample.R 2011-12-30 18:33:23 UTC (rev 237) +++ trunk/BRugs/R/samples.sample.R 2011-12-30 18:39:49 UTC (rev 238) @@ -9,6 +9,8 @@ sM <- samplesMonitors(node)[1] if(sM == "model must be initialized before monitors used") stop("model must be initialized / updated / monitored before samplesSample is used") + if(length(grep("^no monitor set for variable", sM))) + stop(sM) nodeSize <- .OpenBUGS(c("BugsRobjects.SetVariable", "BugsRobjects.GetSize"), c("CharArray","Integer"), list(node,NA))[[2]] This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |