Fix #1986 "Exception when calling dataMaybeMigratedTo()"