Permalink
Browse files

Merge pull request #29 from jefshe/bugfix/deserialize_factors

Don't crash the deserializer if object has an invalid class set
  • Loading branch information...
eddelbuettel committed Aug 11, 2017
2 parents 20cc4ab + af91307 commit d0e88386f5723efd400f9824c68cbd56336ea924
Showing with 5 additions and 1 deletion.
  1. +5 −1 R/rexp_obj.R
View
@@ -98,7 +98,11 @@ unrexp <- function(msg){
if(length(myrexp$attrValue)){
attrib <- lapply(myrexp$attrValue, unrexp)
names(attrib) <- myrexp$attrName
attributes(xobj) <- attrib
tryCatch(attributes(xobj) <- attrib, error=function(cond) {
#Try not setting the class in case the values are invalid
attributes(xobj) <- attrib[names(attrib)!="class"]
warning("Unable to set class, ", cond$message)
})
}
xobj

0 comments on commit d0e8838

Please sign in to comment.