Don't crash the linkpicker if only an anchor has been entered

This commit is contained in:
Kenn Jacobsen
2019-08-22 20:36:26 +02:00
committed by Sebastiaan Janssen
parent 2428af3c40
commit 1089b4b9bb

View File

@@ -93,7 +93,7 @@ angular.module("umbraco").controller("Umbraco.Editors.LinkPickerController",
});
}
} else if ($scope.model.target.url.length) {
} else if ($scope.model.target.url && $scope.model.target.url.length) {
// a url but no id/udi indicates an external link - trim the url to remove the anchor/qs
// only do the substring if there's a # or a ?
var indexOfAnchor = $scope.model.target.url.search(/(#|\?)/);