Skip to content

Commit

Permalink
Merge pull request #221 from heritagemap/Bugfix/168_error-foreign-mem…
Browse files Browse the repository at this point in the history
…orials

Открытие любого памятника не из России роняет сайт #168
  • Loading branch information
Julia-Lavrova authored Apr 20, 2021
2 parents 2030bdf + 989c292 commit 6edacc8
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/utils/getStatus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,11 @@ const IS_OFFICIAL = {
4: '0',
};

const getStatus = (type: Type, knid: string) => (
const getStatus = (type: Type, knid?: string): string => {
if (!knid || !knid[2]) return '';

// @ts-ignore
TYPE_OF_MONUMENT[type + IS_OFFICIAL[knid[2]]] || ''
);
return TYPE_OF_MONUMENT[type + IS_OFFICIAL[knid[2]]] || '';
};

export default getStatus;

0 comments on commit 6edacc8

Please sign in to comment.