Skip to content

Commit

Permalink
fix: Text utils null value when reading module (#24291)
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-s-molina authored Jun 5, 2023
1 parent cab34c2 commit 6a1f365
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions superset-frontend/src/utils/textUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,13 @@
* specific language governing permissions and limitations
* under the License.
*/

/* eslint-disable global-require */
const loadModule = () => {
let module;
try {
// @ts-ignore
module = require('../../../superset_text'); // eslint-disable-line import/no-unresolved
// eslint-disable-next-line global-require
return require('../../../superset_text.yml') || {};
} catch (e) {
module = {};
return {};
}
return module;
};

const supersetText = loadModule();
Expand Down

0 comments on commit 6a1f365

Please sign in to comment.