Fix 1814151: "Add a layer inside an exported canvas crash". Check the return value...