From 7b5b460534e5c54b07d28467c2aa2fc670c714e4 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Thu, 6 Oct 2005 09:17:17 +0000 Subject: Improved error-handling of book module. --- modules/book.module | 6 +++--- modules/book/book.module | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'modules') diff --git a/modules/book.module b/modules/book.module index b950268f8..2b7a33eea 100644 --- a/modules/book.module +++ b/modules/book.module @@ -634,12 +634,12 @@ function book_render() { * - an integer representing the node id (nid) of the node to export * */ -function book_export($type = 'html', $nid = 0) { +function book_export($type = 'html', $nid = FALSE) { global $base_url; $type = drupal_strtolower($type); - if ($nid) { + $node = node_load($nid); + if ($node) { $depth = _book_get_depth($nid); - $node = node_load($nid); switch ($type) { case 'docbook': $xml = "\n"; diff --git a/modules/book/book.module b/modules/book/book.module index b950268f8..2b7a33eea 100644 --- a/modules/book/book.module +++ b/modules/book/book.module @@ -634,12 +634,12 @@ function book_render() { * - an integer representing the node id (nid) of the node to export * */ -function book_export($type = 'html', $nid = 0) { +function book_export($type = 'html', $nid = FALSE) { global $base_url; $type = drupal_strtolower($type); - if ($nid) { + $node = node_load($nid); + if ($node) { $depth = _book_get_depth($nid); - $node = node_load($nid); switch ($type) { case 'docbook': $xml = "\n"; -- cgit v1.2.3