Skip to content

Commit

Permalink
fix: Issue error if user in undefined
Browse files Browse the repository at this point in the history
Signed-off-by: Helio Chissini de Castro <[email protected]>
  • Loading branch information
heliocastro committed Sep 23, 2024
1 parent c859f19 commit 76cc33d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/services/download.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@
import { ApiUtils } from '@/utils'
import { Session } from '@/object-types'

const download = (url: string, session: Session, fileName: string) => {
const download = (url: string, session: Session, fileName: string): void => {
if (!session.user) {
console.error('User is undefined');
return;
}
ApiUtils.GET(url, session.user.access_token)
.then((response) => response.blob())
.then((blob: Blob) => {
Expand Down

0 comments on commit 76cc33d

Please sign in to comment.