bobalosa / androidscreencast

Automatically exported from code.google.com/p/androidscreencast
0 stars 0 forks source link

java.lang.NullPointerException #45

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Device name :
emulator
Device rooted (yes/no) :
yes
Device OS version (1.5/1.6/2.0,...) :
1.6

Computer OS and version (Mac,Win,Linux,...) :
Mac OS X 10.6 Snow Leopard
Java version (java -version from command line) :
1.6
ADB version (adb -version from command line) :
1.0.25
AndroidScreencast version :
0.4

What steps will reproduce the problem?
1. Select Record button
2. Press either Cancel or the close button without selecting anyfile
3. Press Record button again

What is the expected output? What do you see instead?
java.lang.NullPointerException is thrown

Please provide any additional information below.
The toggle button stays selected even if the user picked no file. The button 
should be unselected 
in case JFileChooser.showSaveDialog()'s return value is different from 
JFileChooser.APPROVE_OPTION

        private void startRecording() {
                JFileChooser jFileChooser = new JFileChooser();
                FileNameExtensionFilter filter = new FileNameExtensionFilter(
                                "Video file", "mov");
                jFileChooser.setFileFilter(filter);
                int returnVal = jFileChooser.showSaveDialog(this);
                if (returnVal == JFileChooser.APPROVE_OPTION) {
                        injector.screencapture.startRecording(jFileChooser
                                        .getSelectedFile());
                } 
               else {
                  jtbRecord.setSelected(false);
               }
        }

Original issue reported on code.google.com by ninn...@gmail.com on 24 Feb 2010 at 12:05