diff --git a/src/VistaControlador/Controlador.java b/src/VistaControlador/Controlador.java index dcc14b6..8f6e289 100644 --- a/src/VistaControlador/Controlador.java +++ b/src/VistaControlador/Controlador.java @@ -20,11 +20,13 @@ public class Controlador implements ActionListener,ChangeListener{ public void actionPerformed(ActionEvent e) { if(e.getActionCommand().equals(this.vista.boton.getActionCommand())) { String nombre=JOptionPane.showInputDialog("Introduce un nuevo gasto o ingreso"); + if(nombre==null) return; if(nombre.equals("")) { JOptionPane.showMessageDialog(null, "Debe introducir algo", "error", JOptionPane.WARNING_MESSAGE); return; } String dinero=JOptionPane.showInputDialog("Introduce a cuanto asciende"); + if(dinero==null) return; if(dinero.equals("")) { JOptionPane.showMessageDialog(null, "Debe introducir algo", "error", JOptionPane.WARNING_MESSAGE); return;