Skip to content

Commit 014bd0b

Browse files
Add a null check to Long.equals (bazelbuild#665)
This is a backport of the internal version.
1 parent f3046cd commit 014bd0b

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

closure/library/long.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,9 @@ class Long {
225225
* @return {boolean} Whether this Long equals the other.
226226
*/
227227
equals(other) {
228+
if (other == null) {
229+
return false;
230+
}
228231
// Compare low parts first as there is higher chance they are different.
229232
return (this.low_ == other.low_) && (this.high_ == other.high_);
230233
}

0 commit comments

Comments
 (0)