azatoth/twinkle — pull request #149 by jimmyxu (2013-03-27 14:35:41+00:00)
Title: Set oldProtection after getting API result

If a page is not protected at all, and a user tries to set the edit protection level (leaving the move protection level alone), then he'll get an alert saying "Twinkle couldn't retrieve the existing protection settings."

It seems that the MW API won't return a when the corresponding protection level is not set, therefore `Twinkle.protect.old{Edit,Move}Protection` remains null.

This commit tries to workaround the problem by defaulting those two to `all` after getting API responses.

(Seems ugly though. I don't know if I'm doing this correct, but at least it works.)