Bug 930970 - add nullcheck because of bug 938694 and flushing, to ensure the migration works correctly, r=jaws