diff --git a/modules/book.module b/modules/book.module
index b950268f8cc0bb99dcf1f337e74a7f40532de475..2b7a33eea6b9b4f6d33cb5eea01799bca68889e5 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 = "<?xml version='1.0'?>\n";
diff --git a/modules/book/book.module b/modules/book/book.module
index b950268f8cc0bb99dcf1f337e74a7f40532de475..2b7a33eea6b9b4f6d33cb5eea01799bca68889e5 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 = "<?xml version='1.0'?>\n";