@@ -501,21 +501,22 @@ Countly.endEvent = function(options){
501501
502502// countly sending user data
503503Countly . setUserData = async function ( userData ) {
504+ var message = null ;
504505 if ( ! userData ) {
505- var message = "User profile data should not be null or undefined" ;
506+ message = "User profile data should not be null or undefined" ;
506507 Countly . logError ( "setUserData" , message ) ;
507508 return message ;
508509 }
509510 if ( typeof userData !== 'object' ) {
510- var message = "unsupported data type of user data '" + ( typeof userData ) + "'" ;
511+ message = "unsupported data type of user data '" + ( typeof userData ) + "'" ;
511512 Countly . logWarning ( "setUserData" , message ) ;
512513 return message ;
513514 }
514515 var args = [ ] ;
515516 for ( var key in userData ) {
516517 if ( typeof userData [ key ] != "string" && key . toString ( ) != "byear" )
517518 {
518- var message = "skipping value for key '" + key . toString ( ) + "', due to unsupported data type '" + ( typeof userData [ key ] ) + "', its data type should be 'string'" ;
519+ message = "skipping value for key '" + key . toString ( ) + "', due to unsupported data type '" + ( typeof userData [ key ] ) + "', its data type should be 'string'" ;
519520 Countly . logWarning ( setUserData , message ) ;
520521 }
521522
@@ -850,18 +851,19 @@ Countly.getAvailableFeedbackWidgets = async function(){
850851 * @param {String } closeButtonText - text for cancel/close button
851852 */
852853Countly . presentFeedbackWidgetObject = async function ( feedbackWidget , closeButtonText ) {
854+ var message = null ;
853855 if ( ! feedbackWidget ) {
854- var message = "feedbackWidget should not be null or undefined" ;
856+ message = "feedbackWidget should not be null or undefined" ;
855857 Countly . logError ( "presentFeedbackWidgetObject" , message ) ;
856858 return message ;
857859 }
858860 if ( ! feedbackWidget . id ) {
859- var message = "FeedbackWidget id should not be null or empty" ;
861+ message = "FeedbackWidget id should not be null or empty" ;
860862 Countly . logError ( "presentFeedbackWidgetObject" , message ) ;
861863 return message ;
862864 }
863865 if ( ! feedbackWidget . type ) {
864- var message = "FeedbackWidget type should not be null or empty" ;
866+ message = "FeedbackWidget type should not be null or empty" ;
865867 Countly . logError ( "presentFeedbackWidgetObject" , message ) ;
866868 return message ;
867869 }
@@ -1019,13 +1021,14 @@ Countly.appLoadingFinished = async function(){
10191021 * Supported data type for customMetric values is String
10201022 */
10211023 Countly . setCustomMetrics = async function ( customMetric ) {
1024+ var message = null ;
10221025 if ( ! customMetric ) {
1023- var message = "customMetric should not be null or undefined" ;
1026+ message = "customMetric should not be null or undefined" ;
10241027 Countly . logError ( "setCustomMetrics" , message ) ;
10251028 return message ;
10261029 }
10271030 if ( typeof customMetric !== 'object' ) {
1028- var message = "unsupported data type of customMetric '" + ( typeof customMetric ) + "'" ;
1031+ message = "unsupported data type of customMetric '" + ( typeof customMetric ) + "'" ;
10291032 Countly . logWarning ( "setCustomMetrics" , message )
10301033 return message ;
10311034 }
@@ -1079,18 +1082,19 @@ Countly.validateUserDataValue = async (stringValue, stringName, functionName) =>
10791082 * @returns
10801083 */
10811084Countly . validateUserDataType = async ( stringValue , stringName , functionName ) => {
1085+ var message = null ;
10821086 if ( typeof stringValue == "number" ) {
10831087 return null ;
10841088 }
10851089 if ( typeof stringValue == "string" ) {
1086- var message = "unsupported data type '" + ( typeof stringValue ) + "', its data type should be 'number'" ;
1090+ message = "unsupported data type '" + ( typeof stringValue ) + "', its data type should be 'number'" ;
10871091 Countly . logWarning ( functionName , message ) ;
10881092 return null ;
10891093 }
10901094
1091- var message = "skipping value for '" + stringName . toString ( ) + "', due to unsupported data type '" + ( typeof stringValue ) + "', its data type should be 'number'" ;
1095+ message = "skipping value for '" + stringName . toString ( ) + "', due to unsupported data type '" + ( typeof stringValue ) + "', its data type should be 'number'" ;
10921096 Countly . logError ( functionName , message ) ;
1093- return message
1097+ return message ;
10941098} ;
10951099
10961100/**
0 commit comments