浏览代码

FIX Problème de prénom de contact vide

julien.legrand 8 年之前
父节点
当前提交
9ed05a9039
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      Core/CG67.FicheCollege.Domaine/Utile.cs

+ 3 - 0
Core/CG67.FicheCollege.Domaine/Utile.cs

@@ -13,6 +13,9 @@ namespace CG67.FicheCollege.Domaine
         /// <returns>string formaté en type prénom, exemple : MIckAeL, retournera Mickael</returns>
         public static string formatStringPrenom(string str)
         {
+            //Cas de sortie directe
+            if (string.IsNullOrWhiteSpace(str)) return "";
+
             string retour = str.Substring(0, 1).ToUpper();
             retour += str.Substring(1, str.Length - 1).ToLower();
             return retour;