Skip to content

Commit 4f2c7cf

Browse files
committed
Handle null and undefined globalDisclaimer values.
1 parent 1833194 commit 4f2c7cf

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ export default terria
8585
updateApplicationOnMessageFromParentWindow(terria, window);
8686

8787
// Show a modal disclaimer before user can do anything else.
88-
if (terria.configParameters.globalDisclaimer !== undefined) {
88+
if (terria.configParameters.globalDisclaimer) {
8989
showGlobalDisclaimer(viewState);
9090
}
9191

lib/Views/showGlobalDisclaimer.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ export default function showGlobalDisclaimer(viewState: ViewState) {
99
const globalDisclaimer = terria.configParameters.globalDisclaimer;
1010
const hostname = window.location.hostname;
1111
if (
12-
globalDisclaimer.enableOnLocalhost ||
13-
hostname.indexOf("localhost") === -1
12+
globalDisclaimer &&
13+
(globalDisclaimer.enableOnLocalhost || hostname.indexOf("localhost") === -1)
1414
) {
1515
let message = "";
1616
// Sometimes we want to show a preamble if the user is viewing a site other than the official production instance.

0 commit comments

Comments
 (0)