Skip to content

Commit

Permalink
Merge pull request #1908 from sarahd93/trashcanpage_master
Browse files Browse the repository at this point in the history
handle undefined trash in case of an error
  • Loading branch information
bjoernricks authored Jan 9, 2020
2 parents bdb5c6f + eb30ab9 commit 2822be4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
## [20.04] - unreleased

### Added
- Added handling possible undefined trash in case of an error on the trashcanpage [#1908](https://github.com/greenbone/gsa/pull/1908)
- Added translation using babel-plugin-i18next-extract [#1808](https://github.com/greenbone/gsa/pull/1808)
- Multistep dialog feature, implemented on scanner dialog [#1725](https://github.com/greenbone/gsa/pull/1725)

Expand Down
5 changes: 4 additions & 1 deletion gsa/src/web/pages/extras/trashcanpage.js
Original file line number Diff line number Diff line change
Expand Up @@ -342,10 +342,13 @@ class Trashcan extends React.Component {
}

render() {
const {error, trash, loading} = this.state;
const {error, loading} = this.state;
let {trash} = this.state;

if (!isDefined(trash) && !isDefined(error)) {
return <Loading />;
} else if (!isDefined(trash) && isDefined(error)) {
trash = {};
}

const {scan: tasks, compliance: audits} = separateByUsageType(
Expand Down

0 comments on commit 2822be4

Please sign in to comment.