Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
fluttertoast
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
songyanzhi
fluttertoast
Commits
651023e9
Unverified
Commit
651023e9
authored
Aug 29, 2020
by
cook
Committed by
GitHub
Aug 29, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix crash : If title or message is object of NSNull class can make the app crash (#217)
Co-authored-by: 郭智强 <cook.guo@ximalaya.com>
parent
1c9f50bb
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
ios/Classes/UIView+Toast.m
+2
-2
No files found.
ios/Classes/UIView+Toast.m
View file @
651023e9
...
@@ -221,7 +221,7 @@ static const NSString * CSToastQueueKey = @"CSToastQueueKey";
...
@@ -221,7 +221,7 @@ static const NSString * CSToastQueueKey = @"CSToastQueueKey";
imageRect
.
size
.
height
=
imageView
.
bounds
.
size
.
height
;
imageRect
.
size
.
height
=
imageView
.
bounds
.
size
.
height
;
}
}
if
(
title
!=
nil
)
{
if
(
title
!=
nil
&&
[
title
isKindOfClass
:[
NSString
class
]]
)
{
titleLabel
=
[[
UILabel
alloc
]
init
];
titleLabel
=
[[
UILabel
alloc
]
init
];
titleLabel
.
numberOfLines
=
style
.
titleNumberOfLines
;
titleLabel
.
numberOfLines
=
style
.
titleNumberOfLines
;
titleLabel
.
font
=
style
.
titleFont
;
titleLabel
.
font
=
style
.
titleFont
;
...
@@ -240,7 +240,7 @@ static const NSString * CSToastQueueKey = @"CSToastQueueKey";
...
@@ -240,7 +240,7 @@ static const NSString * CSToastQueueKey = @"CSToastQueueKey";
titleLabel
.
frame
=
CGRectMake
(
0
.
0
,
0
.
0
,
expectedSizeTitle
.
width
,
expectedSizeTitle
.
height
);
titleLabel
.
frame
=
CGRectMake
(
0
.
0
,
0
.
0
,
expectedSizeTitle
.
width
,
expectedSizeTitle
.
height
);
}
}
if
(
message
!=
nil
)
{
if
(
message
!=
nil
&&
[
message
isKindOfClass
:[
NSString
class
]]
)
{
messageLabel
=
[[
UILabel
alloc
]
init
];
messageLabel
=
[[
UILabel
alloc
]
init
];
messageLabel
.
numberOfLines
=
style
.
messageNumberOfLines
;
messageLabel
.
numberOfLines
=
style
.
messageNumberOfLines
;
messageLabel
.
font
=
style
.
messageFont
;
messageLabel
.
font
=
style
.
messageFont
;
...
...
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