Skip to content

Commit

Permalink
Add nullcheck to eliminate warning with Code Analysis
Browse files Browse the repository at this point in the history
  • Loading branch information
alexkaratarakis committed Jun 3, 2016
1 parent 0b4359b commit 944daa7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Release/src/utilities/asyncrt_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ scoped_c_thread_locale::xplat_locale scoped_c_thread_locale::c_locale()
scoped_c_thread_locale::xplat_locale *clocale = new scoped_c_thread_locale::xplat_locale();
#ifdef _WIN32
*clocale = _create_locale(LC_ALL, "C");
if (*clocale == nullptr)
if (clocale == nullptr || *clocale == nullptr)
{
throw std::runtime_error("Unable to create 'C' locale.");
}
Expand All @@ -74,7 +74,7 @@ scoped_c_thread_locale::xplat_locale scoped_c_thread_locale::c_locale()
};
#else
*clocale = newlocale(LC_ALL, "C", nullptr);
if (*clocale == nullptr)
if (clocale == nullptr || *clocale == nullptr)
{
throw std::runtime_error("Unable to create 'C' locale.");
}
Expand Down

0 comments on commit 944daa7

Please sign in to comment.