fix crash when save painting contain pen