Skip to content

Commit

Permalink
a helper function to deal with structure(NULL)
Browse files Browse the repository at this point in the history
  • Loading branch information
yihui committed Apr 24, 2017
1 parent f950970 commit b7e11d3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions inst/homepage/sitemap.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ pinned_urls = c(

book_listing = function() {

structure = function(x, ...) {
if (is.null(x)) x = list()
base::structure(x, ...)
}

read_meta = function(xml) {
if (!grepl('[.]xml$', xml)) {
return(data.frame(url = readLines(xml), lastmod = NA))
Expand Down

0 comments on commit b7e11d3

Please sign in to comment.