MATLAB: Do I receive a NullPointer exception in MATLAB 7.0.4 (R14SP2) when I save the GUI in GUIDE with a ‘.FIG’ extension

aseditextensionfigfigureguidMATLABsave

I receive the following NullPointer exception in MATLAB 7.0.4 (R14SP2) when I load a file with a '.FIG' (all uppercase letters) extension into GUIDE, modify the GUI, and save the GUI:
??? Error using ==> guidefunc
Error using ==> guidefunc
Java exception occurred:
java.lang.NullPointerException
at com.mathworks.ide.layout.LayoutEditor.writeCompleted(LayoutEditor.java:3161)
at com.mathworks.ide.layout.LayoutEditor.writeCompleted(LayoutEditor.java:3167)
.

Best Answer

There is a bug in MATLAB 6.5 (R13) in the way that GUIDE re-saves edited GUIs which have been saved earlier with a '.FIG' (all uppercase letters) extension.
To work around this issue, rename the GUI to a '.fig' (all lowercase letters) extension instead and open it in GUIDE again.