Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
Flutter Inappwebview
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
李增强
Flutter Inappwebview
Commits
1f3318be
Commit
1f3318be
authored
5 years ago
by
AlexVincent525
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix crash on nil/invalid url.
parent
9c7ac0da
master
v3.0.0
v3.1.0
v3.2.0
v3.3.0
v3.3.0+3
v3.4.0
v3.4.0+1
v3.4.0+2
v4.0.0
v4.0.0+4
v4.0.0+6
v4.0.0+5
v4.0.0+4
v4.0.0
v3.4.0+2
v3.4.0+1
v.3.4.0
v3.3.0+3
v3.3.0
v3.2.0
v3.1.0
v3.0.0
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
6 deletions
+8
-6
ios/Classes/FlutterWebViewController.swift
ios/Classes/FlutterWebViewController.swift
+8
-6
No files found.
ios/Classes/FlutterWebViewController.swift
View file @
1f3318be
...
...
@@ -98,14 +98,16 @@ public class FlutterWebViewController: FlutterMethodCallDelegate, FlutterPlatfor
}
if
initialData
!=
nil
{
let
data
=
(
initialData
!
[
"data"
]
as?
String
)
!
let
mimeType
=
(
initialData
!
[
"mimeType"
]
as?
String
)
!
let
encoding
=
(
initialData
!
[
"encoding"
]
as?
String
)
!
let
baseUrl
=
(
initialData
!
[
"baseUrl"
]
as?
String
)
!
let
data
=
(
initialData
!
[
"data"
])
!
let
mimeType
=
(
initialData
!
[
"mimeType"
])
!
let
encoding
=
(
initialData
!
[
"encoding"
])
!
let
baseUrl
=
(
initialData
!
[
"baseUrl"
])
!
webView
!.
loadData
(
data
:
data
,
mimeType
:
mimeType
,
encoding
:
encoding
,
baseUrl
:
baseUrl
)
}
else
{
webView
!.
loadUrl
(
url
:
URL
(
string
:
initialUrl
)
!
,
headers
:
initialHeaders
)
if
let
url
=
URL
(
string
:
initialUrl
)
{
webView
!.
loadUrl
(
url
:
url
,
headers
:
initialHeaders
)
}
}
}
...
...
@@ -347,7 +349,7 @@ public class FlutterWebViewController: FlutterMethodCallDelegate, FlutterPlatfor
case
"printCurrentPage"
:
if
webView
!=
nil
{
webView
!.
printCurrentPage
(
printCompletionHandler
:
{(
completed
,
error
)
in
if
!
completed
,
let
e
=
error
{
if
!
completed
,
let
_
=
error
{
result
(
false
)
return
}
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment