Set the app key in the config after updating it
Merge pull request #2572 from GrahamCampbell/4.0

Set the app key in the config after updating it
Check null.
Merge branch '4.0'