NPE saving calculated attribute with default type