Skip to content

Commit 3a54486

Browse files
Removing try/catch brakes init call
1 parent 59431ca commit 3a54486

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

src/android/AdColonyPlugin.java

+12-12
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ public class AdColonyPlugin extends CordovaPlugin implements AdColonyAdListener,
5656

5757
private CallbackContext _videoAdCallbackContext;
5858
private CallbackContext _nativeAdCallbackContext;
59-
private boolean _isPreparingVideoAd;
60-
private boolean _hasInitialized;
59+
private boolean _isPreparingVideoAd = false;
60+
private boolean _hasInitialized = false;
6161

6262
@Override
6363
public boolean execute(String action, JSONArray inputs, CallbackContext callbackContext) throws JSONException
@@ -126,17 +126,17 @@ private static String[] toStringArray(JSONArray jsonArray) throws JSONException
126126

127127
private void execInitialize(JSONArray inputs, CallbackContext callbackContext) throws JSONException {
128128
String optionString = "";
129-
// try {
130-
JSONObject options = inputs.getJSONObject(2);
131-
String deviceId = options.getString("deviceId");
132-
String customId = options.getString("customId");
133-
if (deviceId != null) AdColony.setDeviceID( deviceId );
134-
if (customId != null) AdColony.setCustomID( customId );
135-
optionString = options.getString("optionString");
136-
// }
137-
// catch (JSONException exception) {
129+
try {
130+
JSONObject options = inputs.getJSONObject(2);
131+
String deviceId = options.getString("deviceId");
132+
String customId = options.getString("customId");
133+
if (deviceId != null) AdColony.setDeviceID( deviceId );
134+
if (customId != null) AdColony.setCustomID( customId );
135+
optionString = options.getString("optionString");
136+
}
137+
catch (JSONException exception) {
138138
// Do nothing
139-
// }
139+
}
140140
String appId = inputs.getString(0);
141141
String[] zoneIds = toStringArray(inputs.getJSONArray(1));
142142
AdColony.configure( this.cordova.getActivity(), optionString, appId, zoneIds );

0 commit comments

Comments
 (0)