Skip to content

Commit

Permalink
fix(util): fix null TypeError in getHashFromImage
Browse files Browse the repository at this point in the history
  • Loading branch information
bitknox committed Dec 29, 2023
1 parent c6dd6fc commit d2e671d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion dist/utils/utils.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/utils/utils.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/utils/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ export const substringBeforeLast = (str: string, toFind: string) => {
// };

export const getHashFromImage = (url: string) => {
if (url.length === 0 || url === null) {
if (url?.length === 0) {
return '';
} else {
let hash!: string;

Check notice on line 175 in src/utils/utils.ts

View check run for this annotation

codefactor.io / CodeFactor

src/utils/utils.ts#L175

'hash' is defined but never used. (@typescript-eslint/no-unused-vars)
Expand Down

0 comments on commit d2e671d

Please sign in to comment.