Skip to content

Commit

Permalink
Prevent error when searchResult is null (#42)
Browse files Browse the repository at this point in the history
  • Loading branch information
chiatt authored Mar 5, 2025
1 parent 6b447ec commit a4a66bb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -371,13 +371,12 @@ function addDrawControls() {
function addOverlayToMap(overlay: MapLayer) {
overlay.layerdefinitions.forEach((layerDefinition: LayerDefinition) => {
map.value!.on('mouseenter', layerDefinition.id, () => {
map.value!.getCanvas().style.cursor = 'pointer';
map.value!.on("mouseenter", layerDefinition.id, () => {
map.value!.getCanvas().style.cursor = "pointer";
});
map.value!.on('mouseleave', layerDefinition.id, () => {
map.value!.getCanvas().style.cursor = '';
map.value!.on("mouseleave", layerDefinition.id, () => {
map.value!.getCanvas().style.cursor = "";
});
if (!map.value!.getSource(layerDefinition.source!)) {
Expand Down
2 changes: 1 addition & 1 deletion afrc/src/afrc/Search/components/SearchResultItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const resultSelected = inject("resultSelected") as Ref<string>;
const image: Ref<string> = ref("");
onMounted(async () => {
if (props.searchResult) {
if (props.searchResult?._source) {
const res = await fetchImageData(
[props.searchResult._source.resourceinstanceid],
true,
Expand Down

0 comments on commit a4a66bb

Please sign in to comment.