[vlma-devel] commit: Fix a NullPointerException when adding an adapter which is not a DVB-S adapter . (Adrien Grand )
git version control
git at videolan.org
Sun Aug 17 22:21:16 CEST 2008
vlma | branch: master | Adrien Grand <jpountz at videolan.org> | Sun Aug 17 22:12:02 2008 +0200| [f401cb87673ef4b16f9ce15153db8be5a4bca660] | committer: Adrien Grand
Fix a NullPointerException when adding an adapter which is not a DVB-S adapter.
> http://git.videolan.org/gitweb.cgi/vlma.git/?a=commit;h=f401cb87673ef4b16f9ce15153db8be5a4bca660
---
.../web/server/ServerAdapterAddController.java | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/vlma-webapp/src/main/java/org/videolan/vlma/web/server/ServerAdapterAddController.java b/vlma-webapp/src/main/java/org/videolan/vlma/web/server/ServerAdapterAddController.java
index 400b5bc..7f66d56 100644
--- a/vlma-webapp/src/main/java/org/videolan/vlma/web/server/ServerAdapterAddController.java
+++ b/vlma-webapp/src/main/java/org/videolan/vlma/web/server/ServerAdapterAddController.java
@@ -65,9 +65,10 @@ public class ServerAdapterAddController extends SimpleFormController {
a.setName(adapterName);
a.setServer(server);
server.getAdapters().add(a);
- int satelliteId = ((ServerAdapterAdd) command).getSatellite();
- if (a instanceof DVBSAdapter)
+ if (a instanceof DVBSAdapter) {
+ int satelliteId = ((ServerAdapterAdd) command).getSatellite();
((DVBSAdapter) a).setSatellite(data.getSatellite(satelliteId));
+ }
data.update(server);
return new ModelAndView(getSuccessView(), "server", server.getId());
}
More information about the vlma-devel
mailing list