From 8b9017962e8f337554f9d15f513ede606f8725e2 Mon Sep 17 00:00:00 2001
From: Mark Wells <mark@freeside.biz>
Date: Wed, 7 Dec 2016 16:56:47 -0800
Subject: [PATCH] silence a warning when creating contacts

---
 FS/FS/Password_Mixin.pm | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/FS/FS/Password_Mixin.pm b/FS/FS/Password_Mixin.pm
index 2e400ec9d..963fa542b 100644
--- a/FS/FS/Password_Mixin.pm
+++ b/FS/FS/Password_Mixin.pm
@@ -212,8 +212,9 @@ sub insert_password_history {
     }
   
   } else {
-    warn "unrecognized password encoding '$encoding'; treating as plain text"
-      unless $encoding eq 'plain';
+    if ($encoding and $encoding ne 'plain') {
+      warn "unrecognized password encoding '$encoding'; treating as plain text";
+    }
 
     $auth = $self->_blowfishcrypt( $password );
 
-- 
2.20.1