diff --git a/htmltidy.module b/htmltidy.module
index fadcef5..3da1505 100644
--- a/htmltidy.module
+++ b/htmltidy.module
@@ -134,6 +134,9 @@ function htmltidy_help($path, $arg) {
 function htmltidy_string($text, $input, $settings, &$errors, &$warnings) {
 
   // Fill in any missing configuration with default settings.
+  if(!$settings) {
+      $settings = array();
+  }
   $settings += htmltidy_default_settings();
 
   // If the string is for input, and the option to process input is off, simply

