no jira: couple NPEs are fixed
Project: http://git-wip-us.apache.org/repos/asf/openmeetings/repo Commit: http://git-wip-us.apache.org/repos/asf/openmeetings/commit/60193a53 Tree: http://git-wip-us.apache.org/repos/asf/openmeetings/tree/60193a53 Diff: http://git-wip-us.apache.org/repos/asf/openmeetings/diff/60193a53 Branch: refs/heads/3.2.x Commit: 60193a5313b59dff257d7b9085ccb7a59a9bde56 Parents: 1a85ede Author: Maxim Solodovnik <[email protected]> Authored: Fri Mar 24 09:58:47 2017 +0000 Committer: Maxim Solodovnik <[email protected]> Committed: Fri Mar 24 09:58:47 2017 +0000 ---------------------------------------------------------------------- .../core/remote/RecordingService.java | 25 ++++++++++---------- .../db/entity/basic/Configuration.java | 2 +- 2 files changed, 13 insertions(+), 14 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/openmeetings/blob/60193a53/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/RecordingService.java ---------------------------------------------------------------------- diff --git a/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/RecordingService.java b/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/RecordingService.java index 549503a..eae5bc0 100644 --- a/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/RecordingService.java +++ b/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/RecordingService.java @@ -52,6 +52,7 @@ import org.red5.server.api.scope.IScope; import org.red5.server.api.service.IPendingServiceCall; import org.red5.server.api.service.IPendingServiceCallback; import org.red5.server.api.service.IServiceCapableConnection; +import org.red5.server.api.stream.IBroadcastStream; import org.red5.server.api.stream.IStreamListener; import org.red5.server.stream.ClientBroadcastStream; import org.slf4j.Logger; @@ -250,22 +251,10 @@ public class RecordingService implements IPendingServiceCallback { */ public void stopRecordingShow(IScope scope, String broadcastId, Long metaId) { try { - if (metaId == null) { - // this should be fixed, can be useful for debugging, after all this is an error - // but we don't want the application to completely stop the process - log.error("recordingMetaDataId is null"); - } - log.debug("** stopRecordingShow: " + scope); log.debug("### Stop recording show for broadcastId: " + broadcastId + " || " + scope.getContextPath()); - Object streamToClose = scopeApplicationAdapter.getBroadcastStream(scope, broadcastId); - - StreamListener listenerAdapter = streamListeners.get(metaId); - - log.debug("Stream Closing :: " + metaId); - - ClientBroadcastStream stream = (ClientBroadcastStream) streamToClose; + IBroadcastStream stream = scopeApplicationAdapter.getBroadcastStream(scope, broadcastId); // the stream can be null if the user just closes the browser // without canceling the recording before leaving @@ -278,6 +267,16 @@ public class RecordingService implements IPendingServiceCallback { } } + if (metaId == null) { + // this should be fixed, can be useful for debugging, after all this is an error + // but we don't want the application to completely stop the process + log.error("recordingMetaDataId is null"); + return; + } + + StreamListener listenerAdapter = streamListeners.get(metaId); + log.debug("Stream Closing :: " + metaId); + RecordingMetaData metaData = metaDataDao.get(metaId); BaseConverter.printMetaInfo(metaData, "Stopping the stream"); // Manually call finish on the stream so that there is no endless loop waiting in the RecordingConverter waiting for the stream to finish http://git-wip-us.apache.org/repos/asf/openmeetings/blob/60193a53/openmeetings-db/src/main/java/org/apache/openmeetings/db/entity/basic/Configuration.java ---------------------------------------------------------------------- diff --git a/openmeetings-db/src/main/java/org/apache/openmeetings/db/entity/basic/Configuration.java b/openmeetings-db/src/main/java/org/apache/openmeetings/db/entity/basic/Configuration.java index 73b4fb3..5319d04 100644 --- a/openmeetings-db/src/main/java/org/apache/openmeetings/db/entity/basic/Configuration.java +++ b/openmeetings-db/src/main/java/org/apache/openmeetings/db/entity/basic/Configuration.java @@ -41,7 +41,7 @@ import org.simpleframework.xml.Root; @Entity @NamedQueries({ - @NamedQuery(name = "forceGetConfigurationByKey", query = "SELECT c FROM Configuration c " + @NamedQuery(name = "forceGetConfigurationByKey", query = "SELECT c FROM Configuration c " + "WHERE c.key LIKE :key"), @NamedQuery(name = "getConfigurationsByKeys", query = "SELECT c FROM Configuration c " + "WHERE c.key IN :keys and c.deleted = false"),
