From c135394bfcbe4c5f3b75ec4acdcafe8975130a81 Mon Sep 17 00:00:00 2001 From: 7c00 Date: Thu, 30 May 2019 12:48:28 +0800 Subject: [PATCH] Fix #70 #72 --- package.json | 2 +- src/geolocation.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 176f8e0..fbbbaed 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "location", "geolocation" ], - "version": "1.0.2", + "version": "1.0.3", "author": "7c00 ", "repository": { "type": "git", diff --git a/src/geolocation.ts b/src/geolocation.ts index 2344d1c..64281c2 100644 --- a/src/geolocation.ts +++ b/src/geolocation.ts @@ -85,7 +85,7 @@ export default class Geolocation { ) { const listener = addLocationListener(location => { if (location.errorCode) { - error(new PositionError(location.errorCode, location.errorInfo, location)); + error && error(new PositionError(location.errorCode, location.errorInfo, location)); } else { success(toPosition(location)); } @@ -107,7 +107,7 @@ export default class Geolocation { ) { watchMap[++watchId] = addLocationListener(location => { if (location.errorCode) { - error(new PositionError(location.errorCode, location.errorInfo, location)); + error && error(new PositionError(location.errorCode, location.errorInfo, location)); } else { success(toPosition(location)); }