Skip to content

Commit

Permalink
fix: check for null or undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
AlejandroAkbal committed Apr 12, 2022
1 parent 2ea4773 commit a494777
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion middleware/FixPostsRoute.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ function isRouteNotCorrect(context) {
const URL_DOMAIN = context.query.domain
const URL_PAGE = context.query.domain

return URL_DOMAIN === undefined || URL_PAGE === undefined
return URL_DOMAIN == null || URL_PAGE == null
}

function generateCorrectRoute(context) {
Expand Down
6 changes: 3 additions & 3 deletions store/booru.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const getters = {
const domain = rootGetters['url/urlDomain']

// Set default booru
if (domain === undefined) {
if (domain == null) {
return findBoorusWithValueByKey(
state.history.lastDomainUsed,
'domain',
Expand All @@ -58,7 +58,7 @@ export const getters = {
const pageID = rootGetters['url/urlPage']

// Get default value
if (pageID === undefined) {
if (pageID == null) {
return getters.getActiveBooruType.initialPageID
}

Expand All @@ -69,7 +69,7 @@ export const getters = {
const tags = rootGetters['url/urlTags']

// Set default value
if (tags === undefined) {
if (tags == null) {
return []
}

Expand Down

0 comments on commit a494777

Please sign in to comment.