Skip to content

Commit dd26b85

Browse files
committed
Auto-generated commit
1 parent 08b4e7a commit dd26b85

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -558,6 +558,7 @@ A total of 24 issues were closed in this release:
558558

559559
<details>
560560

561+
- [`d705c4c`](https://github.com/stdlib-js/stdlib/commit/d705c4ce5bd726a4be870909e5c62b87927858c5) - **refactor:** guard against `null` and `undefined` _(by Athan Reines)_
561562
- [`27f1ef7`](https://github.com/stdlib-js/stdlib/commit/27f1ef7f2cc984271a6de66ad2dff042651e750a) - **test:** ensure full branch coverage _(by Athan Reines)_
562563
- [`1908bae`](https://github.com/stdlib-js/stdlib/commit/1908bae6fe4852798ed12f620b59af50f762f2e5) - **feat:** add support for `struct` and `DataType` dtype values _(by Athan Reines)_
563564
- [`a83bb3d`](https://github.com/stdlib-js/stdlib/commit/a83bb3d053dd235dff135913f0c582e5c4391b80) - **refactor:** use assertion utility _(by Athan Reines)_

base/bytes-per-element/lib/main.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,11 @@ function bytesPerElement( dtype ) {
6060
if ( isString( dtype ) ) {
6161
return BYTES_PER_ELEMENT[ dtype ] || null;
6262
}
63-
v = dtype.byteLength;
64-
if ( isPositiveInteger( v ) ) {
65-
return v;
63+
if ( dtype ) {
64+
v = dtype.byteLength;
65+
if ( isPositiveInteger( v ) ) {
66+
return v;
67+
}
6668
}
6769
return null;
6870
}

0 commit comments

Comments
 (0)