[
https://issues.apache.org/jira/browse/CB-8023?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14220217#comment-14220217
]
Kevin Turner commented on CB-8023:
----------------------------------
Checking {{messageParts.length}} sounds like it would catch if someone did
{{console.log()}}, but the usage we're running into is more like
{code}
function frobUser(user) {
console.log(user);
}
{code}
and someone passes {{null}} to {{frobUser}}, or neglects to pass the {{user}}
argument. I may be misunderstanding how messageParts is built (I'm not clear on
why part 0 is treated differently than the others), but I expect in that case
{{messageParts.length}} would be true, but {{messageParts\[0].toString}} would
still be an error.
> weinre console.log fails when given null value
> ----------------------------------------------
>
> Key: CB-8023
> URL: https://issues.apache.org/jira/browse/CB-8023
> Project: Apache Cordova
> Issue Type: Bug
> Components: weinre
> Reporter: Kevin Turner
> Assignee: Patrick Mueller
> Labels: easyfix, easytest
>
> weinre's Console._generic, through which all console.log messages go,
> contains this line:
> https://github.com/apache/cordova-weinre/blob/f8bcc48f84d9d08f04993328124a62b6bc5026c4/weinre.web/modules/weinre/target/Console.coffee#L78
> message = messageParts[0].toString()
> When messageParts[0] is null, that fails with "null is not an object" (on
> cordova on iOS, other browsers may have different messages but also may not
> have a toString on null).
> It's a small mistake but terrifically annoying to track down such a crash
> introduced by this debugging tool.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]