Skip to content

Undefined and Null handling #1

@Philzen

Description

@Philzen

Null values are not handled correctly, e.g.

measurement('Speed').convert(null).from('km/h').to('m/s');       // = 0
measurement('Speed').convert(undefined).from('km/h').to('m/s');  // = NaN
measurement('Temperature').convert(null).from('c').to('k');      // = 273.15
measurement('Temperature').convert(null).from('f').to('c');      // = -17.77777777777778
measurement('Temperature').convert(undefined).from('c').to('k'); // = NaN

Internally any conversion operations must be avoided if value is null or undefined and it should just be returned again.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions