소스 검색

check for null with toLocalString (#14208)

Ryan McKinley 7 년 전
부모
커밋
b3e6da0cbd
1개의 변경된 파일6개의 추가작업 그리고 0개의 파일을 삭제
  1. 6 0
      public/app/core/utils/kbn.ts

+ 6 - 0
public/app/core/utils/kbn.ts

@@ -428,10 +428,16 @@ kbn.valueFormats.hex0x = (value, decimals) => {
 };
 
 kbn.valueFormats.sci = (value, decimals) => {
+  if (value == null) {
+    return '';
+  }
   return value.toExponential(decimals);
 };
 
 kbn.valueFormats.locale = (value, decimals) => {
+  if (value == null) {
+    return '';
+  }
   return value.toLocaleString(undefined, { maximumFractionDigits: decimals });
 };