Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

V1.x patches #2530

Merged
merged 2 commits into from
Mar 5, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions android/capacitor/src/main/java/com/getcapacitor/Plugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ public void pluginRequestPermission(String permission, int requestCode) {
*/
private void addEventListener(String eventName, PluginCall call) {
List<PluginCall> listeners = eventListeners.get(eventName);
if (listeners == null) {
if (listeners == null || listeners.isEmpty()) {
listeners = new ArrayList<PluginCall>();
eventListeners.put(eventName, listeners);

Expand Down Expand Up @@ -335,7 +335,7 @@ private void removeEventListener(String eventName, PluginCall call) {
protected void notifyListeners(String eventName, JSObject data, boolean retainUntilConsumed) {
Log.v(getLogTag(), "Notifying listeners for event " + eventName);
List<PluginCall> listeners = eventListeners.get(eventName);
if (listeners == null) {
if (listeners == null || listeners.isEmpty()) {
Log.d(getLogTag(), "No listeners found for event " + eventName);
if (retainUntilConsumed) {
retainedEventArguments.put(eventName, data);
Expand Down
4 changes: 3 additions & 1 deletion cli/src/cordova.ts
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,9 @@ ${applicationXMLEntries.join('\n')}
${rootXMLEntries.join('\n')}
</manifest>`;
content = content.replace(new RegExp(('$PACKAGE_NAME').replace('$', '\\$&'), 'g'), config.app.appId);
await writeFileAsync(manifestPath, content);
if (existsSync(manifestPath)) {
await writeFileAsync(manifestPath, content);
}
}

function getPathParts(path: string) {
Expand Down