browser.c: Don't require > 0 chars in logging

Sometimes JavaScript chooses to log an empty string.  We should
honour that by requiring msg be a valid empty string.

Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
This commit is contained in:
Daniel Silverstone 2019-06-09 15:20:17 +01:00
parent c5c8a49276
commit 03624bcf7a
1 changed files with 4 additions and 1 deletions

View File

@ -3458,7 +3458,10 @@ nserror browser_window_console_log(struct browser_window *bw,
struct browser_window *root = browser_window_get_root(bw);
assert(msg != NULL);
assert(msglen > 0);
/* We don't assert msglen > 0, if someone wants to log a real empty
* string then we won't stop them. It does sometimes happen from
* JavaScript for example.
*/
/* bw is the target of the log, but root is where we log it */