From 67eb847389422ccfd7d313981e51bc659aa8dfec Mon Sep 17 00:00:00 2001 From: Varun Talwar Date: Wed, 21 Dec 2016 19:00:11 -0500 Subject: [PATCH] Throw exception if illegal arguments are passed to queueSceneUpdates --- android/tangram/src/com/mapzen/tangram/MapController.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/android/tangram/src/com/mapzen/tangram/MapController.java b/android/tangram/src/com/mapzen/tangram/MapController.java index c8bd874758..e3b65accc3 100644 --- a/android/tangram/src/com/mapzen/tangram/MapController.java +++ b/android/tangram/src/com/mapzen/tangram/MapController.java @@ -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()); } @@ -764,6 +767,9 @@ public void queueSceneUpdate(SceneUpdate sceneUpdate) { */ public void queueSceneUpdate(List 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); }