From 7095a7ca7d985d5447aed80cf3e41a4f8c19b954 Mon Sep 17 00:00:00 2001
From: Alexander Akait <4567934+alexander-akait@users.noreply.github.com>
Date: Wed, 24 Mar 2021 14:39:04 +0300
Subject: [PATCH 1/2] fix: crash with thread-loader (#1281)

---
 src/utils.js | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/utils.js b/src/utils.js
index 7bc36537..5cbd52db 100644
--- a/src/utils.js
+++ b/src/utils.js
@@ -71,7 +71,7 @@ function defaultGetLocalIdent(
   let relativeMatchResource = "";
 
   // eslint-disable-next-line no-underscore-dangle
-  if (loaderContext._module.matchResource) {
+  if (loaderContext._module && loaderContext._module.matchResource) {
     relativeMatchResource = `${normalizePath(
       // eslint-disable-next-line no-underscore-dangle
       path.relative(options.context, loaderContext._module.matchResource)
@@ -138,7 +138,8 @@ const icssRegExp = /\.icss\.\w+$/i;
 function getModulesOptions(rawOptions, loaderContext) {
   const resourcePath =
     // eslint-disable-next-line no-underscore-dangle
-    loaderContext._module.matchResource || loaderContext.resourcePath;
+    (loaderContext._module && loaderContext._module.matchResource) ||
+    loaderContext.resourcePath;
 
   let isIcss;
 

From c86ff945224fca49c409cffd758cc58a7e48f676 Mon Sep 17 00:00:00 2001
From: evilebottnawi <sheo13666q@gmail.com>
Date: Wed, 24 Mar 2021 14:39:51 +0300
Subject: [PATCH 2/2] chore(release): 5.1.4

---
 CHANGELOG.md      | 7 +++++++
 package-lock.json | 2 +-
 package.json      | 2 +-
 3 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index f205a346..ed061aab 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,6 +2,13 @@
 
 All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
 
+### [5.1.4](https://github.com/webpack-contrib/css-loader/compare/v5.1.3...v5.1.4) (2021-03-24)
+
+
+### Bug Fixes
+
+* crash with thread-loader ([#1281](https://github.com/webpack-contrib/css-loader/issues/1281)) ([7095a7c](https://github.com/webpack-contrib/css-loader/commit/7095a7ca7d985d5447aed80cf3e41a4f8c19b954))
+
 ### [5.1.3](https://github.com/webpack-contrib/css-loader/compare/v5.1.2...v5.1.3) (2021-03-15)
 
 
diff --git a/package-lock.json b/package-lock.json
index 1db38618..870033b5 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,6 +1,6 @@
 {
   "name": "css-loader",
-  "version": "5.1.3",
+  "version": "5.1.4",
   "lockfileVersion": 2,
   "requires": true,
   "packages": {
diff --git a/package.json b/package.json
index cdccbd86..ef511c87 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
 {
   "name": "css-loader",
-  "version": "5.1.3",
+  "version": "5.1.4",
   "description": "css loader module for webpack",
   "license": "MIT",
   "repository": "webpack-contrib/css-loader",