Skip to content

Commit 2d244e4

Browse files
authored
Refactor 404 handling (#880)
1 parent 6e54f01 commit 2d244e4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/plugins/archive.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ module.exports = class Archive {
1717
})
1818
return data
1919
} catch (error) {
20-
if (error.status === 404 && !this.getDesiredArchiveState()) {
20+
if (error.status === 404) {
2121
return null
2222
}
2323
throw error
@@ -59,13 +59,13 @@ module.exports = class Archive {
5959
shouldArchive (repository = this.repository) {
6060
const desiredState = this.getDesiredArchiveState()
6161
if (desiredState === null) return false
62-
return !repository.archived && desiredState
62+
return !repository?.archived && desiredState
6363
}
6464

6565
shouldUnarchive (repository = this.repository) {
6666
const desiredState = this.getDesiredArchiveState()
6767
if (desiredState === null) return false
68-
return repository.archived && !desiredState
68+
return repository?.archived && !desiredState
6969
}
7070

7171
isArchived () {

0 commit comments

Comments
 (0)