Issue #1131: Attachment migration sometimes fails due to Hibernate Session errors
Fixed wrong boolean condition