Fix npe on load

This commit is contained in:
Paulo Gustavo Veiga 2022-02-21 06:02:21 -08:00
parent 9650d27490
commit 2c57631ce6

View File

@ -52,8 +52,13 @@ abstract class PersistenceManager {
} }
} }
protected getCSRFToken(): string { protected getCSRFToken(): string | null {
return document.head.querySelector('meta[name="_csrf"]').getAttribute('content'); const meta = document.head.querySelector('meta[name="_csrf"]');
let result = null;
if (meta) {
result = meta.getAttribute('content');
}
return result;
} }
load(mapId: string) { load(mapId: string) {