Deltares / imod-python

🐍🧰 Make massive MODFLOW models
https://deltares.github.io/imod-python/
MIT License
16 stars 0 forks source link

None access in budget.py and package.py #1097

Open deltamarnix opened 3 days ago

deltamarnix commented 3 days ago

I was playing around with Coverity Scan and it gave me two results, which is a super nice score in the first place!

CID 429696: (#1 of 1): Attribute/item access or function call before check for None or undefined (REVERSE_INULL) check_after_deref: Null-checking front suggests that it may be null, but it has already been dereferenced on all paths leading to the check.

In package.py:292, we see the use of front, but front can be None here: for itime in range(front.coords["time"].size):. And within the for, there is again a check to see if front is None.

The same happens in budget.py:292