Skip to content

Commit 944daa7

Browse files
Add nullcheck to eliminate warning with Code Analysis
1 parent 0b4359b commit 944daa7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Release/src/utilities/asyncrt_utils.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ scoped_c_thread_locale::xplat_locale scoped_c_thread_locale::c_locale()
6363
scoped_c_thread_locale::xplat_locale *clocale = new scoped_c_thread_locale::xplat_locale();
6464
#ifdef _WIN32
6565
*clocale = _create_locale(LC_ALL, "C");
66-
if (*clocale == nullptr)
66+
if (clocale == nullptr || *clocale == nullptr)
6767
{
6868
throw std::runtime_error("Unable to create 'C' locale.");
6969
}
@@ -74,7 +74,7 @@ scoped_c_thread_locale::xplat_locale scoped_c_thread_locale::c_locale()
7474
};
7575
#else
7676
*clocale = newlocale(LC_ALL, "C", nullptr);
77-
if (*clocale == nullptr)
77+
if (clocale == nullptr || *clocale == nullptr)
7878
{
7979
throw std::runtime_error("Unable to create 'C' locale.");
8080
}

0 commit comments

Comments
 (0)