Changeset d415fa


Ignore:
Timestamp:
Mar 24, 2012, 9:03:28 PM (10 years ago)
Author:
rene <rene@…>
Branches:
ng_0.9
Children:
a5070c
Parents:
7c85ef
Message:

prevent field errors

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • content/vI_getHeader.js

    r7c85ef rd415fa  
    5151            var headerNameToSearch = headerToSearch_splitted[0].toLowerCase()
    5252            // check second or third part for any number
    53             var headerNumberToSearch = parseInt(headerToSearch_splitted[1])
    54             if (isNaN(headerNumberToSearch)) headerNumberToSearch = parseInt(headerToSearch_splitted[2])
     53            var headerNumberToSearch = null;
     54            if (headerToSearch_splitted.length > 1) parseInt(headerToSearch_splitted[1]);
     55            if (isNaN(headerNumberToSearch) && headerToSearch_splitted.length > 2) headerNumberToSearch = parseInt(headerToSearch_splitted[2]);
    5556           
    5657            // create header name to store the value
    57             var headerNameToStore = headerNameToSearch
     58            var headerNameToStore = headerNameToSearch;
    5859            if (!isNaN(headerNumberToSearch)) headerNameToStore += ":" + headerNumberToSearch
    5960           
  • modules/vI_smartIdentityCollection.js

    r7c85ef rd415fa  
    233233            var replyHeaderName = replyHeader_splitted[0].toLowerCase()
    234234            // check second or third part for any number
    235             var replyHeaderNumber = parseInt(replyHeader_splitted[1])
    236             if (isNaN(replyHeaderNumber)) replyHeaderNumber = parseInt(replyHeader_splitted[2])
     235            var replyHeaderNumber = null;
     236            if (replyHeader_splitted.length > 1) parseInt(replyHeader_splitted[1]);
     237            if (isNaN(replyHeaderNumber) && replyHeader_splitted.length > 2) replyHeaderNumber = parseInt(replyHeader_splitted[2]);
    237238            // check if Fullnames should be erased
    238239            var replyHeaderEmptyFullNames = ((replyHeader_splitted[1] && replyHeader_splitted[1].match(/@/)) ||
    239                             (replyHeader_splitted[2] && replyHeader_splitted[2].match(/@/)))
     240                            (replyHeader_splitted[2] && replyHeader_splitted[2].match(/@/)));
    240241           
    241242            // create header name to find the value
Note: See TracChangeset for help on using the changeset viewer.