Thanks to visit codestin.com
Credit goes to github.com

Skip to content

encoder.js encodeDate func throw exceptions when dt is null #84

@zheli-1

Description

@zheli-1

Hi, there.

I am running an auto script testing framework and found out it might be a bug in encoder.js:

it's when encoderDate's argument is null, it throws exceptions so could a condition to avoid this.

Can you verify if it's a potential bug? it would be helpful for my experiment:)

function encodeDate (dt) {
var encoded
//filter
if(dt === null){
return;
}
//zl3
var millis = dt * 1
var seconds = Math.floor(millis / 1000)
var nanos = (millis - (seconds * 1000)) * 1E6

if (nanos || seconds > 0xFFFFFFFF) {

After adding the following line, in test scripting timestamps.js passes.
I will send a pull request if necessary :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions