Merge pull request #1050 from blattms/make-wells_equal-work-for-null-wells

Make wells_equal work for null wells.
This commit is contained in:
Bård Skaflestad
2016-06-27 15:18:09 +02:00
committed by GitHub

View File

@@ -545,6 +545,16 @@ bool
wells_equal(const struct Wells *W1, const struct Wells *W2 , bool verbose)
/* ---------------------------------------------------------------------- */
{
// Cater the case where W1 and W2 are the same (null) pointers.
if( W1 == W2 )
{
return true;
}
if( W1 == NULL || W2 == NULL)
{
return false;
}
bool are_equal = true;
are_equal = (W1->number_of_wells == W2->number_of_wells);
are_equal = are_equal && (W1->number_of_phases == W2->number_of_phases);