issue #21670: Check for model instead of index to avoid tripping on discard/refresh routine.
Merge pull request #925 from jrogelstad/21670

issue #21670: Check for model instead of index to avoid tripping on disc...