diff --git a/includes/menu.inc b/includes/menu.inc index d5e45a0c51e279ce3ed040769731806db94bebb3..312812aa06b05f89c0b0a4500a005260cbfb600e 100644 --- a/includes/menu.inc +++ b/includes/menu.inc @@ -2340,10 +2340,11 @@ function _menu_router_build($callbacks) { } array_multisort($sort, SORT_NUMERIC, $menu); - if ($menu) { - // Delete the existing router since we have some data to replace it. - db_query('DELETE FROM {menu_router}'); + if (!$menu) { + return array(); } + // Delete the existing router since we have some data to replace it. + db_query('DELETE FROM {menu_router}'); // Apply inheritance rules. foreach ($menu as $path => $v) { $item = &$menu[$path];