note11g / flutter_naver_map

Naver Mobile Dynamic Map SDK for Flutter (unofficial)
BSD 3-Clause "New" or "Revised" License
143 stars 69 forks source link

[All Platform] `NLocationOverlay.setSubIcon(null)` Cause NPE #142

Closed note11g closed 11 months ago

note11g commented 11 months ago

Reproduce Code

final NLocationOverlay locationOverlay = await mapController.getLocationOverlay();
locationOverlay.setSubIcon(null);

Cause

https://github.com/note11g/flutter_naver_map/blob/fdd735459ac679926ec67f073004124892830168/android/src/main/kotlin/dev/note11/flutter_naver_map/flutter_naver_map/controller/overlay/handler/LocationOverlayHandler.kt#L24

https://github.com/note11g/flutter_naver_map/blob/fdd735459ac679926ec67f073004124892830168/ios/Classes/controller/overlay/handler/LocationOverlayHandler.swift#L63

Logs

Android

java.lang.NullPointerException
E/MethodChannel#flutter_naver_map_overlay#0(13424):     at dev.note11.flutter_naver_map.flutter_naver_map.controller.overlay.handler.LocationOverlayHandler$DefaultImpls.handleLocationOverlay(LocationOverlayHandler.kt:24)
E/MethodChannel#flutter_naver_map_overlay#0(13424):     at dev.note11.flutter_naver_map.flutter_naver_map.controller.overlay.OverlayController.handleLocationOverlay(OverlayController.kt:32)
E/MethodChannel#flutter_naver_map_overlay#0(13424):     at dev.note11.flutter_naver_map.flutter_naver_map.controller.overlay.OverlayController$handler$overlayHandleFunc$10.invoke(OverlayController.kt:122)
E/MethodChannel#flutter_naver_map_overlay#0(13424):     at dev.note11.flutter_naver_map.flutter_naver_map.controller.overlay.OverlayController$handler$overlayHandleFunc$10.invoke(OverlayController.kt:122)
E/MethodChannel#flutter_naver_map_overlay#0(13424):     at dev.note11.flutter_naver_map.flutter_naver_map.controller.overlay.OverlayController.handler(OverlayController.kt:124)
E/MethodChannel#flutter_naver_map_overlay#0(13424):     at dev.note11.flutter_naver_map.flutter_naver_map.controller.overlay.OverlayController.$r8$lambda$x3t98W9KAiqviSjw3VmnMZcgiKo(Unknown Source:0)
E/MethodChannel#flutter_naver_map_overlay#0(13424):     at dev.note11.flutter_naver_map.flutter_naver_map.controller.overlay.OverlayController$$ExternalSyntheticLambda1.onMethodCall(Unknown Source:2)
E/MethodChannel#flutter_naver_map_overlay#0(13424):     at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:267)
E/MethodChannel#flutter_naver_map_overlay#0(13424):     at io.flutter.embedding.engine.dart.DartMessenger.invokeHandler(DartMessenger.java:295)
E/MethodChannel#flutter_naver_map_overlay#0(13424):     at io.flutter.embedding.engine.dart.DartMessenger.lambda$dispatchMessageToQueue$0$io-flutter-embedding-engine-dart-DartMessenger(DartMessenger.java:322)
E/MethodChannel#flutter_naver_map_overlay#0(13424):     at io.flutter.embedding.engine.dart.DartMessenger$$ExternalSyntheticLambda0.run(Unknown Source:12)
E/MethodChannel#flutter_naver_map_overlay#0(13424):     at android.os.Handler.handleCallback(Handler.java:942)
E/MethodChannel#flutter_naver_map_overlay#0(13424):     at android.os.Handler.dispatchMessage(Handler.java:99)
E/MethodChannel#flutter_naver_map_overlay#0(13424):     at android.os.Looper.loopOnce(Looper.java:201)
E/MethodChannel#flutter_naver_map_overlay#0(13424):     at android.os.Looper.loop(Looper.java:288)
E/MethodChannel#flutter_naver_map_overlay#0(13424):     at android.app.ActivityThread.main(ActivityThread.java:7872)
E/MethodChannel#flutter_naver_map_overlay#0(13424):     at java.lang.reflect.Method.invoke(Native Method)
E/MethodChannel#flutter_naver_map_overlay#0(13424):     at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
E/MethodChannel#flutter_naver_map_overlay#0(13424):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)
E/flutter (13424): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: PlatformException(error, null, null, java.lang.NullPointerException
E/flutter (13424):  at dev.note11.flutter_naver_map.flutter_naver_map.controller.overlay.handler.LocationOverlayHandler$DefaultImpls.handleLocationOverlay(LocationOverlayHandler.kt:24)
E/flutter (13424):  at dev.note11.flutter_naver_map.flutter_naver_map.controller.overlay.OverlayController.handleLocationOverlay(OverlayController.kt:32)
E/flutter (13424):  at dev.note11.flutter_naver_map.flutter_naver_map.controller.overlay.OverlayController$handler$overlayHandleFunc$10.invoke(OverlayController.kt:122)
E/flutter (13424):  at dev.note11.flutter_naver_map.flutter_naver_map.controller.overlay.OverlayController$handler$overlayHandleFunc$10.invoke(OverlayController.kt:122)
E/flutter (13424):  at dev.note11.flutter_naver_map.flutter_naver_map.controller.overlay.OverlayController.handler(OverlayController.kt:124)
E/flutter (13424):  at dev.note11.flutter_naver_map.flutter_naver_map.controller.overlay.OverlayController.$r8$lambda$x3t98W9KAiqviSjw3VmnMZcgiKo(Unknown Source:0)
E/flutter (13424):  at dev.note11.flutter_naver_map.flutter_naver_map.controller.overlay.OverlayController$$ExternalSyntheticLambda1.onMethodCall(Unknown Source:2)
E/flutter (13424):  at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:267)
E/flutter (13424):  at io.flutter.embedding.engine.dart.DartMessenger.invokeHandler(DartMessenger.java:295)
E/flutter (13424):  at io.flutter.embedding.engine.dart.DartMessenger.lambda$dispatchMessageToQueue$0$io-flutter-embedding-engine-dart-DartMessenger(DartMessenger.java:322)
E/flutter (13424):  at io.flutter.embedding.engine.dart.DartMessenger$$ExternalSyntheticLambda0.run(Unknown Source:12)
E/flutter (13424):  at android.os.Handler.handleCallback(Handler.java:942)
E/flutter (13424):  at android.os.Handler.dispatchMessage(Handler.java:99)
E/flutter (13424):  at android.os.Looper.loopOnce(Looper.java:201)
E/flutter (13424):  at android.os.Looper.loop(Looper.java:288)
E/flutter (13424):  at android.app.ActivityThread.main(ActivityThread.java:7872)
E/flutter (13424):  at java.lang.reflect.Method.invoke(Native Method)
E/flutter (13424):  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
E/flutter (13424):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)
E/flutter (13424): )
E/flutter (13424): #0      StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:651:7)
E/flutter (13424): #1      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:322:18)
E/flutter (13424): <asynchronous suspension>
E/flutter (13424): #2      _NOverlaySender._send (package:flutter_naver_map/src/type/map/overlay/overlay/overlay_sender.dart:21:12)
E/flutter (13424): <asynchronous suspension>
E/flutter (13424): #3      _NOverlaySender._set (package:flutter_naver_map/src/type/map/overlay/overlay/overlay_sender.dart:26:5)
E/flutter (13424): <asynchronous suspension>
E/flutter (13424): 

iOS

Exception: Unable to terminate dev.note11.flutternavermap.flutterNaverMapExample on E195BFA0-917A-4D28-8CAB-CFDA40EBBC3A:
ProcessException: Process exited abnormally:

  Command: /usr/bin/arch -arm64e xcrun simctl terminate E195BFA0-917A-4D28-8CAB-CFDA40EBBC3A dev.note11.flutternavermap.flutterNaverMapExample
the Dart compiler exited unexpectedly.