Skip to content

Commit cf96744

Browse files
Refactor latitude and longitude retrieval in map widget to remove optional chaining
1 parent 1618b0f commit cf96744

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

records_management/static/src/js/map_widget.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ odoo.define('records_management.map_widget', function (require) {
1212
// Clear previous content and add map container
1313
this.$el.html('<div class="map_container"></div>');
1414

15-
var latitude = this.recordData?.[this.options?.latitude_field] ?? undefined;
16-
var longitude = this.recordData?.[this.options?.longitude_field] ?? undefined;
17-
1815
if (!this.recordData || !this.options) {
1916
this.$('.map_container').html('<span>Invalid configuration: record data or options missing.</span>');
2017
return;
2118
}
2219

20+
var latitude = this.recordData[this.options.latitude_field];
21+
var longitude = this.recordData[this.options.longitude_field];
22+
2323
var hasLatitude = !!latitude;
2424
var hasLongitude = !!longitude;
2525
var hasGoogle = typeof google !== 'undefined';

0 commit comments

Comments
 (0)