diff --git a/addons/web_unsplash/static/src/components/media_dialog/image_selector.js b/addons/web_unsplash/static/src/components/media_dialog/image_selector.js
index 81115d8a40a..1b247d9beac 100644
--- a/addons/web_unsplash/static/src/components/media_dialog/image_selector.js
+++ b/addons/web_unsplash/static/src/components/media_dialog/image_selector.js
@@ -115,10 +115,10 @@ patch(ImageSelector.prototype, 'image_selector_unsplash', {
set selectedRecordIds(_) {},
async fetchUnsplashRecords(offset) {
- this.state.isFetchingUnsplash = true;
if (!this.state.needle) {
return { records: [], isMaxed: false };
}
+ this.state.isFetchingUnsplash = true;
try {
const { isMaxed, images } = await this.unsplash.getImages(this.state.needle, offset, this.NUMBER_OF_ATTACHMENTS_TO_DISPLAY, this.props.orientation);
this.state.isFetchingUnsplash = false;