diff --git a/CHANGELOG.md b/CHANGELOG.md index 6783f58e..f9da5d5e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## [Unreleased] + +### Fixed +* Pre-hotreload `cartridge` support (older than 2.4.0) (PR #341). + ## [1.0.0] - 02-02-23 ### Added diff --git a/crud/common/stash.lua b/crud/common/stash.lua index 0fef9af3..43fa09f2 100644 --- a/crud/common/stash.lua +++ b/crud/common/stash.lua @@ -37,7 +37,11 @@ stash.name = { -- @return Returns -- function stash.setup_cartridge_reload() - local hotreload = require('cartridge.hotreload') + local hotreload_supported, hotreload = pcall(require, 'cartridge.hotreload') + if not hotreload_supported then + return + end + for _, name in pairs(stash.name) do hotreload.whitelist_globals({ name }) end