From 268f1cc42c187b7d048c02579f0a1fd9e80ffa72 Mon Sep 17 00:00:00 2001 From: kilig Date: Tue, 22 Aug 2023 11:28:54 +0900 Subject: [PATCH] Fix issue for checking return value of Interop (#5491) Signed-off-by: Inkyun Kil --- .../Tizen.Applications/RemoteView.cs | 37 ++++++++++++---------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/src/Tizen.Applications.RemoteView/Tizen.Applications/RemoteView.cs b/src/Tizen.Applications.RemoteView/Tizen.Applications/RemoteView.cs index 1354735..72f95f1 100755 --- a/src/Tizen.Applications.RemoteView/Tizen.Applications/RemoteView.cs +++ b/src/Tizen.Applications.RemoteView/Tizen.Applications/RemoteView.cs @@ -124,31 +124,34 @@ namespace Tizen.Applications internal static void CheckException(Interop.WidgetViewerEvas.ErrorCode err) { - switch (err) + if (err != Interop.WidgetViewerEvas.ErrorCode.None) { - case Interop.WidgetViewerEvas.ErrorCode.Fault: - throw new InvalidOperationException("Fault at unmanaged code"); + switch (err) + { + case Interop.WidgetViewerEvas.ErrorCode.Fault: + throw new InvalidOperationException("Fault at unmanaged code"); - case Interop.WidgetViewerEvas.ErrorCode.PermissionDenied: - throw new UnauthorizedAccessException(); + case Interop.WidgetViewerEvas.ErrorCode.PermissionDenied: + throw new UnauthorizedAccessException(); - case Interop.WidgetViewerEvas.ErrorCode.NotSupported: - throw new NotSupportedException(); + case Interop.WidgetViewerEvas.ErrorCode.NotSupported: + throw new NotSupportedException(); - case Interop.WidgetViewerEvas.ErrorCode.InvalidParameter: - throw new InvalidOperationException("Invalid parameter error at unmanaged code"); + case Interop.WidgetViewerEvas.ErrorCode.InvalidParameter: + throw new InvalidOperationException("Invalid parameter error at unmanaged code"); - case Interop.WidgetViewerEvas.ErrorCode.AlreadyExist: - throw new InvalidOperationException("Already exist"); + case Interop.WidgetViewerEvas.ErrorCode.AlreadyExist: + throw new InvalidOperationException("Already exist"); - case Interop.WidgetViewerEvas.ErrorCode.MaxExceeded: - throw new InvalidOperationException("Max exceeded"); + case Interop.WidgetViewerEvas.ErrorCode.MaxExceeded: + throw new InvalidOperationException("Max exceeded"); - case Interop.WidgetViewerEvas.ErrorCode.Disabled: - throw new InvalidOperationException("Disabled"); + case Interop.WidgetViewerEvas.ErrorCode.Disabled: + throw new InvalidOperationException("Disabled"); - default: - throw new InvalidOperationException("Invalid Operation"); + default: + throw new InvalidOperationException("Invalid Operation"); + } } } -- 2.7.4