Skip to content

Commit

Permalink
Throw exception if illegal arguments are passed to queueSceneUpdates
Browse files Browse the repository at this point in the history
  • Loading branch information
tallytalwar committed Dec 22, 2016
1 parent 7575409 commit 67eb847
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions android/tangram/src/com/mapzen/tangram/MapController.java
Original file line number Diff line number Diff line change
Expand Up @@ -755,6 +755,9 @@ public void setDebugFlag(DebugFlag flag, boolean on) {
*/
public void queueSceneUpdate(SceneUpdate sceneUpdate) {
checkPointer(mapPointer);
if (sceneUpdate == null) {
throw new IllegalArgumentException("sceneUpdate can not be null in queueSceneUpdates");
}
nativeQueueSceneUpdate(mapPointer, sceneUpdate.getPath(), sceneUpdate.getValue());
}

Expand All @@ -764,6 +767,9 @@ public void queueSceneUpdate(SceneUpdate sceneUpdate) {
*/
public void queueSceneUpdate(List<SceneUpdate> sceneUpdates) {
checkPointer(mapPointer);
if (sceneUpdates == null || sceneUpdates.size() == 0) {
throw new IllegalArgumentException("sceneUpdates can not be null or empty in queueSceneUpdates");
}
String[] updateStrings = bundleSceneUpdates(sceneUpdates);
nativeQueueSceneUpdates(mapPointer, updateStrings);
}
Expand Down

0 comments on commit 67eb847

Please sign in to comment.