diff --git a/src/finiteVolume/fvMatrices/fvMatrix/fvMatrix.C b/src/finiteVolume/fvMatrices/fvMatrix/fvMatrix.C
index 254436784f3e1c4e492f68a249b335a9b81dc0f1..b00996c073b893db4379eb568814deef4d45fbe0 100644
--- a/src/finiteVolume/fvMatrices/fvMatrix/fvMatrix.C
+++ b/src/finiteVolume/fvMatrices/fvMatrix/fvMatrix.C
@@ -258,7 +258,9 @@ void Foam::fvMatrix<Type>::setValuesFromList
 
             for (const label facei : cells[celli])
             {
-                if (mesh.isInternalFace(facei))
+                const label patchi = mesh.boundaryMesh().patchID(facei);
+
+                if (patchi == -1)
                 {
                     if (symmetric())
                     {
@@ -290,8 +292,6 @@ void Foam::fvMatrix<Type>::setValuesFromList
                 }
                 else
                 {
-                    const label patchi = mesh.boundaryMesh().whichPatch(facei);
-
                     if (internalCoeffs_[patchi].size())
                     {
                         const label patchFacei =