Handle saved builds and old URLs

This commit is contained in:
Cmdr McDonald
2016-11-14 11:57:39 +00:00
parent 0c94c81746
commit 4486aa2e2b
5 changed files with 17 additions and 13 deletions

View File

@@ -65,7 +65,7 @@ export function shallowEqual(objA, objB) {
* @return {string} the converted string
*/
export function toUrlSafe(data) {
return data.replace(/\//g, '-').replace(/\+/g, '_');
return data ? data.replace(/\//g, '-').replace(/\+/g, '_') : null;
}
/**
@@ -74,5 +74,5 @@ export function toUrlSafe(data) {
* @return {string} the converted string
*/
export function fromUrlSafe(data) {
return data.replace(/-/g, '/').replace(/_/g, '+');
return data ? data.replace(/-/g, '/').replace(/_/g, '+') : null;
}